From 4b5e091b3963d71fe93661103f0c25a5a3a6431d Mon Sep 17 00:00:00 2001 From: jmoenig Date: Mon, 14 Jun 2021 22:53:12 +0200 Subject: [PATCH] associate setting with JSF-block rather than the evaluator --- HISTORY.md | 1 + src/threads.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/HISTORY.md b/HISTORY.md index 09cd78a3..3841d131 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -10,6 +10,7 @@ * updated animation library * updated frequency-distribution-analysis library * extensions: added some world-map extension primitives +* threads: associate setting with JSF-block rather than the evaluator ## 6.9.0 * **Notable Changes:** diff --git a/src/threads.js b/src/threads.js index 9d6e9565..55419e07 100644 --- a/src/threads.js +++ b/src/threads.js @@ -1208,6 +1208,9 @@ Process.prototype.reifyPredicate = function (topBlock, parameterNames) { }; Process.prototype.reportJSFunction = function (parmNames, body) { + if (!this.enableJS) { + throw new Error('JavaScript extensions for Snap!\nare turned off'); + } return Function.apply( null, parmNames.itemsArray().concat([body]) @@ -1227,9 +1230,11 @@ Process.prototype.evaluate = function ( return this.returnValueToParentContext(null); } if (context instanceof Function) { + /* if (!this.enableJS) { throw new Error('JavaScript extensions for Snap!\nare turned off'); } + */ return context.apply( this.blockReceiver(), args.itemsArray().concat([this])