summaryrefslogtreecommitdiff
path: root/threads.js
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2014-11-26 16:26:53 +0100
committerjmoenig <jens@moenig.org>2014-11-26 16:26:53 +0100
commit320bfd0c990ea60e1dcf6bfdbe7538b203283709 (patch)
tree11136b30c37d7e4bec940b422ed019d6a39edb0d /threads.js
parent723c232f3d6655bb592b98333a2397d3cc2689c1 (diff)
downloadsnap-yow-320bfd0c990ea60e1dcf6bfdbe7538b203283709.tar.gz
snap-yow-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.
Diffstat (limited to 'threads.js')
-rw-r--r--threads.js37
1 files changed, 20 insertions, 17 deletions
diff --git a/threads.js b/threads.js
index bdb780a..59dd23a 100644
--- a/threads.js
+++ b/threads.js
@@ -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);
};