Closed
Bug 987110
Opened 11 years ago
Closed 11 years ago
Make codegen fail if a dictionary shadows something on Object.prototype
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla31
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
Attachments
(1 file, 1 obsolete file)
|
5.34 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
Because that won't work with the Xrays-to-Object bholley wants to set up.
The full list, if I read GlobalObject::initFunctionAndObjectClasses is:
1) "constructor"
2) Everything in object_methods (toSource, toString, toLocaleString, valueOf,
watch, unwatch, hasOwnProperty, isPrototypeOf, propertyIsEnumerable,
__defineGetter__, __definesetter__, __lookupGetter__, __lookupSetter__)
3) __proto__
Object.getOwnPropertyNames seems to return that list, minus __proto__ (because it's JSPROP_SHARED or something?).
Jason, do you know how likely it is that new things will get added here?
Flags: needinfo?(jorendorff)
Comment 1•11 years ago
|
||
(In reply to Boris Zbarsky [:bz] from comment #0)
> Because that won't work with the Xrays-to-Object bholley wants to set up.
For reference, this is bug 987111.
| Assignee | ||
Comment 2•11 years ago
|
||
Attachment #8395695 -
Flags: review?(bobbyholley)
| Assignee | ||
Updated•11 years ago
|
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
| Assignee | ||
Comment 3•11 years ago
|
||
Attachment #8395730 -
Flags: review?(bobbyholley)
| Assignee | ||
Updated•11 years ago
|
Attachment #8395695 -
Attachment is obsolete: true
Attachment #8395695 -
Flags: review?(bobbyholley)
Comment 4•11 years ago
|
||
Comment on attachment 8395730 [details] [diff] [review]
Disallow dictionary members that would shadow Object.prototype properties.
Review of attachment 8395730 [details] [diff] [review]:
-----------------------------------------------------------------
rs=me
::: dom/bindings/test/mochitest.ini
@@ +35,5 @@
> [test_lenientThis.html]
> [test_lookupGetter.html]
> [test_namedNoIndexed.html]
> [test_named_getter_enumerability.html]
> +[test_Object.prototype_props.html]
can we call this test_Object_prototype_props.html? This is the first time I've ever seen a . in a filename like this, so it seems inconsistent, and likely to break some fringe piece of automation.
Attachment #8395730 -
Flags: review?(bobbyholley) → review+
| Assignee | ||
Comment 5•11 years ago
|
||
I considered that, but we have a ton of test names like this already, in fact:
find . -name "test_[^.]*.[^.]*.[^.]*" | grep -v .hg/store | wc -l
225
| Assignee | ||
Comment 6•11 years ago
|
||
Er, I guess that includes the imptests .foo.json files, but even if I exclude those:
find . -name "test_[^.]*.[^.]*.[^.]*" | grep -v .hg/store | grep -v json | wc -l
160
and all of these look legit.
Comment 7•11 years ago
|
||
Shrug. It just seems much more conventional to use an underscore, and less surprising.
| Assignee | ||
Comment 8•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/db3cd3239562 but I kept the naming. It makes sense to do it if it doesn't break anything, and makes it clearer that Object.prototype is not the same thing as "Object prototype" here.
Flags: needinfo?(jorendorff) → in-testsuite-
Comment 9•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•