diff options
| author | jmoenig <jens@moenig.org> | 2014-11-26 16:26:53 +0100 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2014-11-26 16:26:53 +0100 |
| commit | 320bfd0c990ea60e1dcf6bfdbe7538b203283709 (patch) | |
| tree | 11136b30c37d7e4bec940b422ed019d6a39edb0d | |
| parent | 723c232f3d6655bb592b98333a2397d3cc2689c1 (diff) | |
| download | snap-byow-320bfd0c990ea60e1dcf6bfdbe7538b203283709.tar.gz snap-byow-320bfd0c990ea60e1dcf6bfdbe7538b203283709.zip | |
Fixed #656
make sure to always evaluate the “report” block’s input, even if used
inside a custom command definition, because hardware extensions (and
other reporters with side-effects) rely on it.
| -rwxr-xr-x | history.txt | 4 | ||||
| -rw-r--r-- | threads.js | 37 |
2 files changed, 24 insertions, 17 deletions
diff --git a/history.txt b/history.txt index 7d876c8..39a801d 100755 --- a/history.txt +++ b/history.txt @@ -2358,3 +2358,7 @@ ______ ------- * Threads: Evaluator optimizations (reducing the stack size for reporters) * Threads: Full TCO (tail-call-elimination), now Snap! *is* Scheme :-) + +1411225 +------- +* Threads: Fixed #656 @@ -83,7 +83,7 @@ ArgLabelMorph, localize, XML_Element, hex_sha512*/ // Global stuff //////////////////////////////////////////////////////// -modules.threads = '2014-November-25'; +modules.threads = '2014-November-26'; var ThreadManager; var Process; @@ -551,28 +551,31 @@ Process.prototype.reportAnd = function (block) { }; Process.prototype.doReport = function (block) { + var outer = this.context.outerContext; if (this.context.expression.partOfCustomCommand) { this.doStopCustomBlock(); this.popContext(); - return; - } - var outer = this.context.outerContext; - while (this.context && this.context.tag !== 'exit') { - if (this.context.expression === 'doStopWarping') { - this.doStopWarping(); - } else { - this.popContext(); + } else { + while (this.context && this.context.tag !== 'exit') { + if (this.context.expression === 'doStopWarping') { + this.doStopWarping(); + } else { + this.popContext(); + } } - } - if (this.context) { - if (this.context.expression === 'expectReport') { - // pop off inserted top-level exit context - this.popContext(); - } else { - // un-tag and preserve original caller - this.context.tag = null; + if (this.context) { + if (this.context.expression === 'expectReport') { + // pop off inserted top-level exit context + this.popContext(); + } else { + // un-tag and preserve original caller + this.context.tag = null; + } } } + // in any case evaluate (and ignore) + // the input, because it could be + // and HTTP Request for a hardware extension this.pushContext(block.inputs()[0], outer); }; |
