Re: [w3c/webcomponents] JavaScript bundlers, HMR and customElements.define() (#829)

> After downgrade, the element will still be the same referenced object in a WeakMap key, the same object at some position in an array, etc. It doesn't matter where the reference is, it'd be the same reference, and all those places would continue to rely on that same reference.

Known truths about the value would be invalidated. The assumption inherent in these assertions is that one would only ever be running code in an environment where all other code is one’s own / trusted. What you’re describing would invert ownership in a way that prevents maintaining a boundary between trusted and untrusted code.

Also note that an element’s own properties could have been defined as unconfigurable or the object could have [[IsExtensible]] false, and that attempted reinitialization of private fields throws a TypeError. Therefore ‘reconstructing’ the same object is guaranteed to throw if it has private fields.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/829#issuecomment-560011436

Received on Saturday, 30 November 2019 18:55:03 UTC