Add STATEMENT_SUFFIX

Also remove need to manually indent INFINITE_LOOP_TRAP.  This is a breaking change for Python users of this property.  However, very few users of this property exist, given that the existing code breaks if the block ID has a $ in it (also fixed in this PR).
This commit is contained in:
Neil Fraser
2019-05-10 23:19:35 -07:00
committed by Neil Fraser
parent 35cbed1584
commit ba18ae2159
7 changed files with 83 additions and 34 deletions

View File

@@ -516,7 +516,7 @@ Code.initLanguage = function() {
* Just a quick and dirty eval. Catch infinite loops.
*/
Code.runJS = function() {
Blockly.JavaScript.INFINITE_LOOP_TRAP = ' checkTimeout();\n';
Blockly.JavaScript.INFINITE_LOOP_TRAP = 'checkTimeout();\n';
var timeouts = 0;
var checkTimeout = function() {
if (timeouts++ > 1000000) {