summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-11-26 13:23:35 +0100
committerjmoenig <jens@moenig.org>2013-11-26 13:23:35 +0100
commitdf1d6ca4792b9a5b7aadc23b45bf2061a62484df (patch)
tree12fda542ce2a6f2ca363105e56bde66862795e4d
parentd3c735fadef2e74d9050bc7933fa884300f4d57c (diff)
downloadsnap-yow-df1d6ca4792b9a5b7aadc23b45bf2061a62484df.tar.gz
snap-yow-df1d6ca4792b9a5b7aadc23b45bf2061a62484df.zip
Threads: fixed #133 - preserve edge-cased argument types
(empty string, Boolean false)
-rwxr-xr-xhistory.txt1
-rw-r--r--threads.js6
2 files changed, 4 insertions, 3 deletions
diff --git a/history.txt b/history.txt
index 7a02a86..d00869d 100755
--- a/history.txt
+++ b/history.txt
@@ -2017,3 +2017,4 @@ ______
* Threads: Text comparisons are now case-sensitive („fixes“ #175)
* Threads: fixed #179 - don’t identify primitive (static) C-Slots as implicit formal parameters
* Threads: fixed #249 - preserve variable value types with edge cases (empty string, Boolean false)
+* Threads: fixed #133 - preserve edge-cased argument types (empty string, Boolean false)
diff --git a/threads.js b/threads.js
index 3ff7a50..78831cf 100644
--- a/threads.js
+++ b/threads.js
@@ -789,7 +789,7 @@ Process.prototype.evaluate = function (
// assign formal parameters
for (i = 0; i < context.inputs.length; i += 1) {
value = 0;
- if (parms[i]) {
+ if (!isNil(parms[i])) {
value = parms[i];
}
outer.variables.addVar(context.inputs[i], value);
@@ -858,7 +858,7 @@ Process.prototype.fork = function (context, args) {
// assign formal parameters
for (i = 0; i < context.inputs.length; i += 1) {
value = 0;
- if (parms[i]) {
+ if (!isNil(parms[i])) {
value = parms[i];
}
outer.variables.addVar(context.inputs[i], value);
@@ -1018,7 +1018,7 @@ Process.prototype.evaluateCustomBlock = function () {
// assign formal parameters
for (i = 0; i < context.inputs.length; i += 1) {
value = 0;
- if (parms[i]) {
+ if (!isNil(parms[i])) {
value = parms[i];
}
outer.variables.addVar(context.inputs[i], value);