mirror of
https://github.com/google/blockly.git
synced 2026-01-04 15:40:08 +01:00
Use null-prototype objects for maps
A {} has a bunch of names already defined on it (like ‘toString’). When using an object as a map with arbitrary keys, it should not inherit from Object.prototype.
This commit is contained in:
@@ -14,12 +14,12 @@ goog.provide('Blockly.PHP.procedures');
|
||||
|
||||
goog.require('Blockly.PHP');
|
||||
|
||||
|
||||
Blockly.PHP['procedures_defreturn'] = function(block) {
|
||||
// Define a procedure with a return value.
|
||||
// First, add a 'global' statement for every variable that is not shadowed by
|
||||
// a local parameter.
|
||||
var globals = [];
|
||||
var varName;
|
||||
var workspace = block.workspace;
|
||||
var variables = Blockly.Variables.allUsedVarModels(workspace) || [];
|
||||
for (var i = 0, variable; variable = variables[i]; i++) {
|
||||
|
||||
Reference in New Issue
Block a user