Closed
Bug 856647
Opened 12 years ago
Closed 11 years ago
Throw on Object.preventExtensions(document)
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: bruant.d, Unassigned)
References
Details
From WebIDL:
http://dev.w3.org/2006/webapi/WebIDL/#indexed-and-named-properties
> Platform objects implementing an interface that supports indexed or
> named properties cannot be fixed; if Object.freeze, Object.seal or
> Object.preventExtensions is called on one of these objects,
> these the function MUST throw a TypeError.
Currently, Object.preventExtensions(document) doesn't throw while it should.
(thanks Ms2ger for the heads up)
Comment 1•12 years ago
|
||
Presumably moving to WebIDL bindings here will fix. Certainly it works right for nodelists.
Comment 2•12 years ago
|
||
One spec question: Should Object.preventExtensions(window) throw? As spec is written right now, yes, but that doesn't seem right to me.
Flags: needinfo?(cam)
Comment 3•12 years ago
|
||
If it doesn't throw, then you need to define what happens if new indexed properties are meant to appear on the object. Having them appear when the object has [[Extensible]] == false would violate the rules for host objects in http://es5.github.com/#x8.6.2. I thought it would be simpler to disallow this rather than define the set of visible indexed properties to be capped at what it is at the time Object.preventExtensions() is called.
Flags: needinfo?(cam)
Comment 4•12 years ago
|
||
Ah, I had forgotten that indexed properties are on the object itself. So yeah, throwing for a window makes sense, esp. as you're always talking about a WindowProxy anyway.
Comment 5•11 years ago
|
||
Looks fixed here.
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Assignee | ||
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
•