mirror of
https://github.com/google/blockly.git
synced 2026-01-07 09:00:11 +01:00
Properly escape IDs in procedure generators. (#1305)
Issue #251 and #1304.
This commit is contained in:
committed by
Andrew n marshall
parent
f8f807f53c
commit
f34a2c2ed4
@@ -35,9 +35,10 @@ Blockly.Dart['procedures_defreturn'] = function(block) {
|
||||
Blockly.Procedures.NAME_TYPE);
|
||||
var branch = Blockly.Dart.statementToCode(block, 'STACK');
|
||||
if (Blockly.Dart.STATEMENT_PREFIX) {
|
||||
var id = block.id.replace(/\$/g, '$$$$'); // Issue 251.
|
||||
branch = Blockly.Dart.prefixLines(
|
||||
Blockly.Dart.STATEMENT_PREFIX.replace(/%1/g,
|
||||
'\'' + block.id + '\''), Blockly.Dart.INDENT) + branch;
|
||||
'\'' + id + '\''), Blockly.Dart.INDENT) + branch;
|
||||
}
|
||||
if (Blockly.Dart.INFINITE_LOOP_TRAP) {
|
||||
branch = Blockly.Dart.INFINITE_LOOP_TRAP.replace(/%1/g,
|
||||
|
||||
Reference in New Issue
Block a user