We are planning to upgrade GitLab to the latest version this Friday morning. Expect some downtime!

Commit 2ef63304 authored by Steffen Michels's avatar Steffen Michels

Merge branch 'revert-9daf8788' into 'master'

Revert "Merge branch 'add-jsWrapFunWithResult' into 'master'"

See merge request !316
parents e5c41f3d 07aa8079
Pipeline #29318 canceled with stage
......@@ -191,11 +191,6 @@ jsDocument :== jsGlobal "document"
jsWrapFun :: !({!JSVal} *JSWorld -> *JSWorld) !JSVal !*JSWorld -> *(!JSFun, !*JSWorld)
* Like {{`jsWrapFun`}}, but the Clean function can return a result.
jsWrapFunWithResult :: !({!JSVal} *JSWorld -> *(JSVal, *JSWorld)) !JSVal !*JSWorld -> *(!JSFun, !*JSWorld)
* Wrap a function receiving a reference to a JavaScript iTasks component to
* one matching the calling convention for the JavaScript interface (i.e.,
......@@ -532,13 +532,6 @@ jsGlobal s = JSVar s
jsWrapFun :: !({!JSVal} *JSWorld -> *JSWorld) !JSVal !*JSWorld -> *(!JSFun, !*JSWorld)
jsWrapFun f attach_to world = (share attach_to \(JSArray args) w -> f args w, world)
jsWrapFunWithResult :: !({!JSVal} *JSWorld -> *(JSVal, *JSWorld)) !JSVal !*JSWorld -> *(!JSFun, !*JSWorld)
jsWrapFunWithResult f attach_to world = (share attach_to fun, world)
fun (JSArray args) w
# (r,w) = f args w
= hyperstrict (js_val_to_string r,w)
wrapInitUIFunction :: !(JSVal *JSWorld -> *JSWorld) -> {!JSVal} -> *JSWorld -> *JSWorld
wrapInitUIFunction f = init
......@@ -125,31 +125,4 @@ const ABC_loading_promise=ABCInterpreter.instantiate({
// Overwrite ap to return a result (in the case of jsWrapFunWithResult)
var f=function () {
var args=[];
for (var i=0; i<arguments.length; i++)
me.abc.interpret(new SharedCleanValue(index), args);
var result=undefined;
const new_asp=me.abc.interpreter.instance.exports.get_asp();
const hp_ptr=me.abc.memory_array[new_asp/4];
if (me.abc.memory_array[hp_ptr/4]!=25*8+2) { // INT, i.e. JSWorld
// Assume we have received a tuple with the first element as the result
const str_ptr=me.abc.memory_array[hp_ptr/4+2];
const string=me.abc.get_clean_string(me.abc.memory_array[str_ptr/4+2], false);
if (typeof result!='undefined')
return result;
return f;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment