metajs
metajs copied to clipboard
The following Code gets stuck
Code sample: function Human() { this.H1 = 87;} var Obj = { Name:"Palash" } Human.apply( Obj ); //------------------------------------------ Error: Function name: CPSFunction.prototype.apply in (bundle.js) errCont is undefined. //------------------------------------------
The error is here: https://github.com/int3/metajs/blob/a13f69c4679a3b0ee9206698fdd32de1f5304154/lib/interpreter.coffee#L110
The Function.prototype.apply implementation assumes a non-null second argument.
Even with a non null argument it fails. Code sample: function Human(age) { this.H1 = age;} var Obj = { Name:"Palash" } Human.apply( Obj,[12] ); Human.call(Obj,12) //<----------------- this fails too. //-------------------------------------------- Also, Function.prototype.call is not implemented yet. Is that a correct assumption? //--------------------------------------------