From c0b91b5fa2f785d186f4c4b356e43ceb2048d6ca Mon Sep 17 00:00:00 2001 From: jmoenig Date: Mon, 28 Jul 2014 14:41:15 +0200 Subject: enable “JS function” block to create custom control structures and HOFs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- history.txt | 5 +++++ threads.js | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/history.txt b/history.txt index f391645..0caf24b 100755 --- a/history.txt +++ b/history.txt @@ -2233,3 +2233,8 @@ ______ ------ * Objects, Threads: new “JavaScript function” primitive. Go figure… * GUI: updated Credits + +140728 +------ +* Lists: fixed "Load Failed Type Error Cannot read property 'isLinked' of null" +* Threads: enable “JS function” block to create custom control structures and HOFs diff --git a/threads.js b/threads.js index da96207..4989a23 100644 --- a/threads.js +++ b/threads.js @@ -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); -- cgit v1.3.1