Define built-in functions with the full name.

Improves error messages and stack traces.
This commit is contained in:
Tor Andersson
2016-04-28 12:57:22 +02:00
parent 4b68d52351
commit a2fcfd69fe
12 changed files with 145 additions and 143 deletions

View File

@@ -199,10 +199,10 @@ void jsB_initfunction(js_State *J)
js_pushobject(J, J->Function_prototype);
{
jsB_propf(J, "toString", Fp_toString, 2);
jsB_propf(J, "apply", Fp_apply, 2);
jsB_propf(J, "call", Fp_call, 1);
jsB_propf(J, "bind", Fp_bind, 1);
jsB_propf(J, "Function.prototype.toString", Fp_toString, 2);
jsB_propf(J, "Function.prototype.apply", Fp_apply, 2);
jsB_propf(J, "Function.prototype.call", Fp_call, 1);
jsB_propf(J, "Function.prototype.bind", Fp_bind, 1);
}
js_newcconstructor(J, jsB_Function, jsB_Function, "Function", 1);
js_defglobal(J, "Function", JS_DONTENUM);