ref: 6f93cab7ffcb73d64d45ecc746f121c37c73586d
parent: e082e6e61c251b9dd4b3c58e58bd63b4122cbb85
author: Tor Andersson <[email protected]>
date: Thu Jan 23 06:54:11 EST 2020
Fix enumerability of Error and Function properties. The Error.message, Error.stackTrace, Function.prototype properties were defined with the wrong attributes. x
--- a/jserror.c
+++ b/jserror.c
@@ -61,10 +61,10 @@
js_pushobject(J, jsV_newobject(J, JS_CERROR, prototype));
if (top > 1) {
js_pushstring(J, js_tostring(J, 1));
- js_setproperty(J, -2, "message");
+ js_defproperty(J, -2, "message", JS_DONTENUM);
}
if (jsB_stacktrace(J, 1))
- js_setproperty(J, -2, "stackTrace");
+ js_defproperty(J, -2, "stackTrace", JS_DONTENUM);
return 1;
}
--- a/jsvalue.c
+++ b/jsvalue.c
@@ -417,7 +417,7 @@
js_copy(J, -2);
js_defproperty(J, -2, "constructor", JS_DONTENUM);
}
- js_defproperty(J, -2, "prototype", JS_DONTCONF);
+ js_defproperty(J, -2, "prototype", JS_DONTENUM | JS_DONTCONF);
}
}
@@ -445,7 +445,7 @@
js_copy(J, -2);
js_defproperty(J, -2, "constructor", JS_DONTENUM);
}
- js_defproperty(J, -2, "prototype", JS_DONTCONF);
+ js_defproperty(J, -2, "prototype", JS_DONTENUM | JS_DONTCONF);
}
}
@@ -464,7 +464,7 @@
js_rot2(J); /* obj proto */
js_copy(J, -2); /* obj proto obj */
js_defproperty(J, -2, "constructor", JS_DONTENUM);
- js_defproperty(J, -2, "prototype", JS_READONLY | JS_DONTENUM | JS_DONTCONF);
+ js_defproperty(J, -2, "prototype", JS_DONTENUM | JS_DONTCONF);
}
}