Closed
Bug 807001
Opened 12 years ago
Closed 12 years ago
Map.prototype.size and Set.prototype.size should be accessor properties
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla19
People
(Reporter: jorendorff, Assigned: jorendorff)
References
Details
(Keywords: dev-doc-complete)
Attachments
(1 file)
31.47 KB,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
This is a breaking change for any code using .size() on Map or Set objects. The patch includes fixes for in-tree uses.
Assignee | ||
Comment 1•12 years ago
|
||
I considered changing JS_DefineProperty with JSPROP_NATIVE_ACCESSORS so as to make the getter function objects have getter.name == "size", but function object .name properties are totally unspecified. Some other time perhaps.
Assignee: general → jorendorff
Attachment #676658 -
Flags: review?(jwalden+bmo)
Comment 2•12 years ago
|
||
Comment on attachment 676658 [details] [diff] [review]
v1
Review of attachment 676658 [details] [diff] [review]:
-----------------------------------------------------------------
Given that the accessors in { get foo() { } } have no name, and perhaps we might want to self-host this or something at some point, it seems best to not have a name, definitely.
I completely agree with the logical argument for .size over .size(), as made in the es-discuss thread; it's totally rational and correct, and we should have .size, not .size(). But when I look at this, this irrationally looks weird and wrong to me. Maybe it's just because I'm seeing both cases next to each other and there's cross-pollination of smell. I dunno. Forward!
Attachment #676658 -
Flags: review?(jwalden+bmo) → review+
Assignee | ||
Comment 3•12 years ago
|
||
Comment 4•12 years ago
|
||
Please update MDN:
https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Map
https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Set
Keywords: dev-doc-needed
Comment 5•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
Comment 6•12 years ago
|
||
I just updated the Map and Set documentation, including a note that it changed in FF19
Keywords: dev-doc-needed
Looking at this diff from v8 http://code.google.com/p/v8/source/detail?r=12875, they seem to set the getter name to "size".
Updated•12 years ago
|
Keywords: dev-doc-needed
Comment 9•12 years ago
|
||
See comment 6 - I updates the docs on MDN (https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Map and https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Set) and cleared dev-doc-needed based on that. If something else is necessary, please indicate it.
Keywords: dev-doc-needed
Comment 10•12 years ago
|
||
I think this should be mentioned in https://developer.mozilla.org/en-US/docs/Firefox_19_for_developers too.
Comment 11•12 years ago
|
||
(In reply to Kohei Yoshino from comment #10)
> I think this should be mentioned in
> https://developer.mozilla.org/en-US/docs/Firefox_19_for_developers too.
Done :)
You need to log in
before you can comment on or make changes to this bug.
Description
•