Skip to content

Commit 8b58107

Browse files
Renegade334aduh95
andauthored
fixup! doc: add indexed Array.prototype properties to primordial exclusions
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent dcfb44a commit 8b58107

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎doc/contributing/primordials.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,17 @@ array properties via `Array.prototype` breaks a particular Node.js API.
147147
<!-- eslint-disable accessor-pairs -->
148148

149149
```js
150+
// User-land
150151
Object.defineProperty(
151152
Array.prototype,
152153
'0',
153154
{ set() {} },
154155
);
156+
157+
// Core
158+
const array = [];
159+
ArrayPrototypePush(array, 'some value');
160+
console.log(array[0]); // undefined
155161
```
156162

157163
These patterns are expected to break both ECMAScript builtins and application

0 commit comments

Comments
 (0)