Closed
Bug 1103344
Opened 10 years ago
Closed 10 years ago
Remove the try/catch behavior of Object.assign
Categories
(Core :: JavaScript: Standard Library, defect)
Core
JavaScript: Standard Library
Tracking
()
RESOLVED
FIXED
mozilla39
Tracking | Status | |
---|---|---|
firefox39 | --- | fixed |
People
(Reporter: 446240525, Assigned: evilpie)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete, Whiteboard: [DocArea=JS])
Attachments
(1 file)
(deleted),
patch
|
till
:
review+
|
Details | Diff | Splinter Review |
js> obj=Object("0")
(new String("0"))
js> Object.assign(obj, {0:1, 1: 1})
typein:2:0 TypeError: 0 is read-only
js> obj[1]
1 // this should be undefined
TC39 decided to remove this for performance reasons: https://twitter.com/bterlson/status/535921786525736960
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → evilpies
Assignee | ||
Comment 1•10 years ago
|
||
Assignee | ||
Updated•10 years ago
|
Attachment #8580752 -
Flags: review?(till)
Comment 2•10 years ago
|
||
Comment on attachment 8580752 [details] [diff] [review]
Object.assign should stop when an exception is thrown
Review of attachment 8580752 [details] [diff] [review]:
-----------------------------------------------------------------
Mmmmmh, so much nicer!
::: js/src/builtin/Object.js
@@ +30,4 @@
>
> + // Steps 5.c.i-iii. We abbreviate this by calling propertyIsEnumerable
> + // which is faster and returns false for not defined properties.
> + if (callFunction(std_Object_propertyIsEnumerable, from, nextKey)) {
It'd be really nice to inline std_Object_propertyIsEnumerable to substantially speed this up. Perhaps file a bug so it's at least visible?
Attachment #8580752 -
Flags: review?(till) → review+
Assignee | ||
Comment 3•10 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=3e4f8caef1dc
https://hg.mozilla.org/integration/mozilla-inbound/rev/c279eefced07
Filed bug 1147154 for inlining propertyIsEnumerable. That was quick, even before coming back from your vacation! :)
Comment 4•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox39:
--- → fixed
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
Comment 5•10 years ago
|
||
https://developer.mozilla.org/en-US/Firefox/Releases/39#JavaScript
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•