While executing "sleeping" demo on IE an error occurs. In fact, when using setTimeout as function reference within the "JSFun.wat_combine" method the "apply(null, list_to_array(o))" is not callable that way.
My purposed solution was to do the following, but I'd like to ear wat-js author opinion. Simply put I'm relying on my own function called "js_fn_apply" which is then called from "wat_combine" JSFun method.
function js_fn_apply(fn, ctx, args) {
if (fn === setTimeout) {
return setTimeout(args[0], args[1] || 250);
}
return fn.apply(ctx, args);
}
I'm not yet certain this is the best solution for the IE issue, but it solve the problematic instruction call and let the "sleeping.html" flow. (though, just to be completely honest about my IE experimentation, I should add that I've included these polyfills: "Array.prototype.indexOf", "Array.prototype.map" and "Object.create").
While executing "sleeping" demo on IE an error occurs. In fact, when using setTimeout as function reference within the "JSFun.wat_combine" method the "apply(null, list_to_array(o))" is not callable that way.
My purposed solution was to do the following, but I'd like to ear wat-js author opinion. Simply put I'm relying on my own function called "js_fn_apply" which is then called from "wat_combine" JSFun method.
function js_fn_apply(fn, ctx, args) { if (fn === setTimeout) { return setTimeout(args[0], args[1] || 250); } return fn.apply(ctx, args); }
JSFun.prototype.wat_combine = function(e, k, f, o) { return js_fn_apply(this.jsfun, null, list_to_array(o)); };
I'm not yet certain this is the best solution for the IE issue, but it solve the problematic instruction call and let the "sleeping.html" flow. (though, just to be completely honest about my IE experimentation, I should add that I've included these polyfills: "Array.prototype.indexOf", "Array.prototype.map" and "Object.create").