RESOLVED CONFIGURATION CHANGED 125307
DOM objects violate fundamental ES6 invariants
https://bugs.webkit.org/show_bug.cgi?id=125307
Summary DOM objects violate fundamental ES6 invariants
Boris Zbarsky
Reported 2013-12-05 09:42:29 PST
Given this markup: <div>TEXT</div> this script: function serializeDescriptor(desc) { var str = "{ "; for (var prop in desc) { str += prop + ": " + desc[prop] + "; " } return str + "}" } var div = document.querySelector("div"); document.writeln("firstChild descriptor: " + serializeDescriptor(Object.getOwnPropertyDescriptor(div, "firstChild"))); outputs: firstChild descriptor: { value: [object Text]; writable: false; enumerable: true; configurable: false; } In ES6 section 6.1.7.3 (Invariants of the Essential Internal Methods) says: The [[GetOwnProperty]] internal method of all objects must conform to the following invariants for each property of the object: ... If a property is described as a data property and its [[Writable]] and [[Configurable]] are both false, then the SameValue (according to 7.2.3) must be returned for the [[Value]] attribute of the property on all calls to [[GetOwnProperty]]. However simply running div.removeChild(div.firstChild) makes the object's [[GetOwnProperty]] return a descriptor with a different [[Value]].
Attachments
Anne van Kesteren
Comment 1 2024-03-17 09:33:11 PDT
All of this has been revised quite a bit. I think there might still be some invariant violations left, but those are open specification issues.
Note You need to log in before you can comment on or make changes to this bug.