Last active
December 3, 2019 23:49
-
-
Save jridgewell/48c3d6c6ea0e0f087e980b93722fbc00 to your computer and use it in GitHub Desktop.
Non-writable super-super prototype descriptor with TypedArraySet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "use strict"; | |
| const o = { __proto__: new Int32Array(10) }; | |
| Object.defineProperty(Object.prototype, 1.3, { | |
| value: 42, | |
| writable: false, | |
| }); | |
| o[1.3] = 1; // Does this throw? | |
| // If it does, then set finds the Object.prototype[1.3] PropertyDescriptor | |
| console.log(o[1.3]); // Does this find 42 or 0? | |
| // If it returns 0, then set did not find the Object.prototype[1.3] PropertyDescriptor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment