Closed
Bug 1038545
Opened 10 years ago
Closed 10 years ago
Coerce the argument passed to Object.keys using ToObject
Categories
(Core :: JavaScript: Standard Library, defect)
Core
JavaScript: Standard Library
Tracking
()
RESOLVED
FIXED
mozilla35
People
(Reporter: 446240525, Assigned: 446240525)
References
()
Details
(Keywords: dev-doc-complete, Whiteboard: [DocArea=JS])
Attachments
(1 file, 1 obsolete file)
3.17 KB,
patch
|
446240525
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2091.2 Safari/537.36 Steps to reproduce: According to ES6 spec 19.1.2.14 http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys 1. Let obj be ToObject(O). So Object.keys(1) or Object.keys(Symbol("foo")) shouldn't throw any more.
V8 issue here: https://code.google.com/p/v8/issues/detail?id=3443#c1
Updated•10 years ago
|
Component: JavaScript Engine → JavaScript: Standard Library
OS: Mac OS X → All
Hardware: x86 → All
Version: 33 Branch → Trunk
Comment 3•10 years ago
|
||
Weird. Is this change intentional? I don't recall seeing a discussion or meeting notes on this.
(In reply to David Bruant from comment #3) > Weird. Is this change intentional? I don't recall seeing a discussion or > meeting notes on this. Yes, See this tweet by allen: https://twitter.com/ziyunfei/status/488893818620489730
Updated•10 years ago
|
Keywords: dev-doc-needed
Whiteboard: [DocArea=JS]
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
Comment 6•10 years ago
|
||
Let's deal with each of these changes in its own bug. The description of the new bug you filed doesn't at all explain what's going on. On top of that, these are quite a few changes. I'll change your new bug into a meta bug tracking all these related changes, though.
Summary: Object.keys() shouldn't throw when given primitive values as input → Coerce the argument passed to Object.keys using ToObject
try run: https://tbpl.mozilla.org/?tree=Try&rev=cd7ef348706f
Assignee: nobody → 446240525
Attachment #8499958 -
Flags: review?(till)
Comment 8•10 years ago
|
||
Comment on attachment 8499958 [details] [diff] [review] bug-1038545.patch Review of attachment 8499958 [details] [diff] [review]: ----------------------------------------------------------------- Oh, how nice that the specification simplified this so much. :) Please mention this simplification in the commit message: "Coerce the argument passed to Object.keys using ToObject and simplify implementation." For future reference, if you make changes that go beyond what the bug says, please briefly explain why you're making them and why they're ok in a bug comment. In this case, something like "I also simplified the implementation in accordance with the current specification draft. All existing tests still pass." It probably would've taken me just as long to verify the correctness of these changes, but it would at least have spared me some confusion.
Attachment #8499958 -
Flags: review?(till) → review+
Attachment #8499958 -
Attachment is obsolete: true
Attachment #8500096 -
Flags: review+
Comment 11•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/347f87932c77
Keywords: checkin-needed
Comment 12•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/347f87932c77
Status: REOPENED → RESOLVED
Closed: 10 years ago → 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
You need to log in
before you can comment on or make changes to this bug.
Description
•