diff options
| author | jmoenig <jens@moenig.org> | 2014-11-17 10:22:39 +0100 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2014-11-17 10:22:39 +0100 |
| commit | ea05f7859fe5a042f0c0dd49b189c594b9a798d3 (patch) | |
| tree | de4e5748aafed23ae41565ab580c43367f443883 /threads.js | |
| parent | b36a358173fcf4f2a4a77a9c202d6dc0d6c1a7b8 (diff) | |
| download | snap-ea05f7859fe5a042f0c0dd49b189c594b9a798d3.tar.gz snap-ea05f7859fe5a042f0c0dd49b189c594b9a798d3.zip | |
Treat REPORT blocks inside custom command definitions as STOP THIS BLOCK / IGNORE INPUTS
this also enables all existing FINCH blocks and other hardware
extensions again, which used the REPORT (HTTP://) pattern
Diffstat (limited to 'threads.js')
| -rw-r--r-- | threads.js | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -83,7 +83,7 @@ ArgLabelMorph, localize, XML_Element, hex_sha512*/ // Global stuff //////////////////////////////////////////////////////// -modules.threads = '2014-November-15'; +modules.threads = '2014-November-17'; var ThreadManager; var Process; @@ -945,6 +945,9 @@ Process.prototype.fork = function (context, args) { }; Process.prototype.doReport = function (value) { + if (this.context.expression.partOfCustomCommand) { + return this.doStopBlock(); + } while (this.context && this.context.expression !== 'exitReporter') { if (this.context.expression === 'doStopWarping') { this.doStopWarping(); @@ -1042,8 +1045,6 @@ Process.prototype.evaluateCustomBlock = function () { } if (runnable.expression instanceof CommandBlockMorph) { - runnable.expression = runnable.expression.blockSequence(); - // insert a reporter exit tag for the // CALL SCRIPT primitive variant if (this.context.expression.definition.type !== 'command') { @@ -1054,7 +1055,12 @@ Process.prototype.evaluateCustomBlock = function () { outer.receiver ); runnable.parentContext = exit; + } else { // mark all REPORT blocks as being part of a custom command + runnable.expression.allReportBlocks().forEach(function (rb) { + rb.partOfCustomCommand = true; + }); } + runnable.expression = runnable.expression.blockSequence(); } }; |
