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)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla31

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file, 1 obsolete file)

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)
(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.
Blocks: 987111
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #8395695 - Attachment is obsolete: true
Attachment #8395695 - Flags: review?(bobbyholley)
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+
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
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.
Shrug. It just seems much more conventional to use an underscore, and less surprising.
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-
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: