diff options
| author | jmoenig <jens@moenig.org> | 2014-07-28 14:41:15 +0200 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2014-07-28 14:41:15 +0200 |
| commit | c0b91b5fa2f785d186f4c4b356e43ceb2048d6ca (patch) | |
| tree | 383bd1a8e8b759c33fd4e0c7f78837ec9d1a630f /threads.js | |
| parent | d559312b0776891cb196eeb2739c311fd7909ee6 (diff) | |
| download | snap-byow-c0b91b5fa2f785d186f4c4b356e43ceb2048d6ca.tar.gz snap-byow-c0b91b5fa2f785d186f4c4b356e43ceb2048d6ca.zip | |
enable “JS function” block to create custom control structures and HOFs
Diffstat (limited to 'threads.js')
| -rw-r--r-- | threads.js | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -83,7 +83,7 @@ ArgLabelMorph, localize, XML_Element, hex_sha512*/ // Global stuff //////////////////////////////////////////////////////// -modules.threads = '2014-July-27'; +modules.threads = '2014-July-28'; var ThreadManager; var Process; @@ -743,7 +743,7 @@ Process.prototype.reifyPredicate = function (topBlock, parameterNames) { Process.prototype.reportJSFunction = function (parmNames, body) { return Function.apply( - Object.create(null), + null, parmNames.asArray().concat([body]) ); }; @@ -759,7 +759,10 @@ Process.prototype.evaluate = function ( ) { if (!context) {return null; } if (context instanceof Function) { - return context.apply(this.homeContext.receiver, args.asArray()); + return context.apply( + this.homeContext.receiver, + args.asArray().concat([this]) + ); } if (context.isContinuation) { return this.runContinuation(context, args); |
