Closed
Bug 509510
Opened 11 years ago
Closed 10 years ago
Object.getPrototypeOf doesn't match ES5 final draft spec
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Not set
Tracking
()
VERIFIED
FIXED
mozilla1.9.2
People
(Reporter: brendan, Assigned: jimb)
References
Details
(Keywords: dev-doc-complete, Whiteboard: fixed-in-tracemonkey)
Attachments
(2 files, 1 obsolete file)
2.80 KB,
patch
|
mrbkap
:
review+
|
Details | Diff | Splinter Review |
1.46 KB,
patch
|
mrbkap
:
review+
|
Details | Diff | Splinter Review |
It turns out the communication with Ecma TC39 and the ES5 editor mentioned in comment 444787 comment 7 did not result in a change to ES5 draft to tolerate non-null, non-undefined primitive values as arguments. This is too bad, but more consistent with the rest of the new meta-programming APIs in Object, which all have an early step of the form: # If Type(O) is not Object, throw a TypeError exception For some reason the ES3 additions Object.prototype.{hasOwnProperty, isPrototypeOf, propertyIsEnumerable} (which are flawed in other ways, if you think this is a flaw too) all use ToObject on their parameter. We should match the ES5 spec. Apple is, and developers will notice if we don't. Jim, can you get this assigned? Easy patch. Thanks, /be
Assignee | ||
Comment 1•11 years ago
|
||
bug 444787 comment 7
Updated•11 years ago
|
Keywords: dev-doc-complete → dev-doc-needed
Assignee | ||
Updated•11 years ago
|
Assignee: general → jim
Assignee | ||
Comment 2•11 years ago
|
||
Attachment #393604 -
Flags: review?(mrbkap)
Comment 3•11 years ago
|
||
Comment on attachment 393604 [details] [diff] [review] Make Object.getPrototypeOf reject primitives, not coerce them. >Bug 509510: Make Object.getPrototypeOf reject primitives, not coerce them. > >diff --git a/js/src/js.msg b/js/src/js.msg >--- a/js/src/js.msg >+++ b/js/src/js.msg >@@ -310,3 +310,4 @@ MSG_DEF(JSMSG_MISSING_FUN_ARG, 22 > MSG_DEF(JSMSG_JSON_BAD_PARSE, 228, 0, JSEXN_SYNTAXERR, "JSON.parse") > MSG_DEF(JSMSG_JSON_BAD_STRINGIFY, 229, 0, JSEXN_ERR, "JSON.stringify") > MSG_DEF(JSMSG_XDR_CLOSURE_WRAPPER, 230, 1, JSEXN_INTERNALERR, "can't XDR closure wrapper for function {0}") >+MSG_DEF(JSMSG_NOT_OBJECT, 231, 1, JSEXN_TYPEERR, "{0} is not an object") Can you use the error reporting structure from the second to last patch in bug 444787? That also avoids JSDVG_SEARCH_STACK by passing -argc when we don't have to use it. I think you can also ignore the stuff about argc == 0, since that's handled above in that patch.
Assignee | ||
Comment 4•11 years ago
|
||
Attachment #393604 -
Attachment is obsolete: true
Attachment #394179 -
Flags: review?(mrbkap)
Attachment #393604 -
Flags: review?(mrbkap)
Updated•11 years ago
|
Attachment #394179 -
Flags: review?(mrbkap) → review+
Comment 5•11 years ago
|
||
Comment on attachment 394179 [details] [diff] [review] Make Object.getPrototypeOf reject primitives, not coerce them. Now that we're fully in C++-land, I *think* you should be able to combine the initialization of bytes with the declaration, but I'm not sure.
Assignee | ||
Comment 6•11 years ago
|
||
(In reply to comment #5) > (From update of attachment 394179 [details] [diff] [review]) > Now that we're fully in C++-land, I *think* you should be able to combine the > initialization of bytes with the declaration, but I'm not sure. It's always been permissible to combine those, even in pre-standard C.
Assignee | ||
Comment 7•11 years ago
|
||
Attachment #394877 -
Flags: review?(mrbkap)
Updated•11 years ago
|
Attachment #394877 -
Flags: review?(mrbkap) → review+
Assignee | ||
Comment 8•11 years ago
|
||
http://hg.mozilla.org/tracemonkey/rev/c154196995b8 (both patches)
Whiteboard: fixed-in-tracemonkey
Comment 9•10 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/cc0fa7fd8fd8
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Comment 10•10 years ago
|
||
https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Global_Objects/Object/GetPrototypeOf Added a note that this behavior changed.
Keywords: dev-doc-needed → dev-doc-complete
Comment 11•10 years ago
|
||
js/tests/ecma_3_1/Object/regress-444787.js v 1.9.3, 1.9.2
Status: RESOLVED → VERIFIED
Flags: in-testsuite+
You need to log in
before you can comment on or make changes to this bug.
Description
•