You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, this is not only allows client scripts to escape the jsdom environment, it also fools brand checks if prototypes are used:
consturl=newURL("...");constnotURL=Object.create(url);console.log(notURL.href);// should throw TypeError but doesn't
On the other hand, private class properties are immune to this, due to their so-called WeakMap semantics. We could very well use the so-called "super-return trick" to implement IDL objects:
Private properties are supported since Node.js v12.x. They are supposed to be faster than WeakMap, but we should still do some performance investigations. (I expect it to be slower than symbol properties still.)
The text was updated successfully, but these errors were encountered:
Oh I just recently saw this trick on Twitter and thought it might work for our object branding purposes. I was a bit worried about backwards compat, but node v12 sounds perfectly fine.
Right now, we implement wrapping/unwrapping of IDL objects through a symbol:
webidl2js/lib/output/utils.js
Lines 61 to 77 in ab63e7e
However, this is not only allows client scripts to escape the jsdom environment, it also fools brand checks if prototypes are used:
On the other hand, private class properties are immune to this, due to their so-called WeakMap semantics. We could very well use the so-called "super-return trick" to implement IDL objects:
Private properties are supported since Node.js v12.x. They are supposed to be faster than WeakMap, but we should still do some performance investigations. (I expect it to be slower than symbol properties still.)
The text was updated successfully, but these errors were encountered: