summaryrefslogtreecommitdiff
path: root/threads.js
diff options
context:
space:
mode:
authorGubolin <gubolin@fantasymail.de>2014-07-30 18:25:11 +0200
committerGubolin <gubolin@fantasymail.de>2014-07-30 18:25:11 +0200
commit85ea3b6f1ce1f5bbd6021b64efef8ee34fb5ccb8 (patch)
tree9d3b02e63f40db23378fb3d49d45189a05ac73df /threads.js
parentb9ec43451b9feb0c743196e2b4c3419e5ff611f8 (diff)
parent0333925e916acc47c25cdcfec0c3be3d695a825f (diff)
downloadsnap-85ea3b6f1ce1f5bbd6021b64efef8ee34fb5ccb8.tar.gz
snap-85ea3b6f1ce1f5bbd6021b64efef8ee34fb5ccb8.zip
Merge branch 'master' of https://github.com/jmoenig/Snap--Build-Your-Own-Blocks
Diffstat (limited to 'threads.js')
-rw-r--r--threads.js26
1 files changed, 20 insertions, 6 deletions
diff --git a/threads.js b/threads.js
index 4989a23..3324ac6 100644
--- a/threads.js
+++ b/threads.js
@@ -83,7 +83,7 @@ ArgLabelMorph, localize, XML_Element, hex_sha512*/
// Global stuff ////////////////////////////////////////////////////////
-modules.threads = '2014-July-28';
+modules.threads = '2014-July-30';
var ThreadManager;
var Process;
@@ -134,7 +134,11 @@ ThreadManager.prototype.toggleProcess = function (block) {
}
};
-ThreadManager.prototype.startProcess = function (block, isThreadSafe) {
+ThreadManager.prototype.startProcess = function (
+ block,
+ isThreadSafe,
+ exportResult
+) {
var active = this.findProcess(block),
top = block.topBlock(),
newProc;
@@ -147,6 +151,7 @@ ThreadManager.prototype.startProcess = function (block, isThreadSafe) {
}
top.addHighlight();
newProc = new Process(block.topBlock());
+ newProc.exportResult = exportResult;
this.processes.push(newProc);
return newProc;
};
@@ -232,11 +237,17 @@ ThreadManager.prototype.removeTerminatedProcesses = function () {
if (proc.topBlock instanceof ReporterBlockMorph) {
if (proc.homeContext.inputs[0] instanceof List) {
- proc.topBlock.showBubble(new ListWatcherMorph(
- proc.homeContext.inputs[0]
- ));
+ proc.topBlock.showBubble(
+ new ListWatcherMorph(
+ proc.homeContext.inputs[0]
+ ),
+ proc.exportResult
+ );
} else {
- proc.topBlock.showBubble(proc.homeContext.inputs[0]);
+ proc.topBlock.showBubble(
+ proc.homeContext.inputs[0],
+ proc.exportResult
+ );
}
}
} else {
@@ -302,6 +313,8 @@ ThreadManager.prototype.findProcess = function (block) {
httpRequest active instance of an HttpRequest or null
pauseOffset msecs between the start of an interpolated operation
and when the process was paused
+ exportResult boolean flag indicating whether a picture of the top
+ block along with the result bubble shoud be exported
*/
Process.prototype = {};
@@ -325,6 +338,7 @@ function Process(topBlock) {
this.isPaused = false;
this.pauseOffset = null;
this.frameCount = 0;
+ this.exportResult = false;
if (topBlock) {
this.homeContext.receiver = topBlock.receiver();