Remove setProcedureParameters from API (use domToMutation instead).

This commit is contained in:
Neil Fraser
2016-03-22 10:48:13 -07:00
parent d086634394
commit 39fbd24659
6 changed files with 101 additions and 76 deletions

View File

@@ -558,30 +558,12 @@ Blockly.genUid = function() {
var length = 20;
var soupLength = Blockly.genUid.soup_.length;
var id = [];
if (Blockly.genUid.crypto_) {
// Cryptographically strong randomness is supported.
var array = new Uint32Array(length);
Blockly.genUid.crypto_.getRandomValues(array);
for (var i = 0; i < length; i++) {
id[i] = Blockly.genUid.soup_.charAt(array[i] % soupLength);
}
} else {
// Fall back to Math.random for IE 10.
for (var i = 0; i < length; i++) {
id[i] = Blockly.genUid.soup_.charAt(Math.random() * soupLength);
}
for (var i = 0; i < length; i++) {
id[i] = Blockly.genUid.soup_.charAt(Math.random() * soupLength);
}
return id.join('');
};
/**
* Determine if window.crypto or global.crypto exists.
* @this {Object}
* @type {=RandomSource}
* @private
*/
Blockly.genUid.crypto_ = this.crypto;
/**
* Legal characters for the unique ID.
* Should be all on a US keyboard. No XML special characters or control codes.