diff options
author | Antoine du Hamel <duhamelantoine1995@gmail.com> | 2020-12-04 12:35:49 +0100 |
---|---|---|
committer | Node.js GitHub Bot <github-bot@iojs.org> | 2020-12-15 13:25:55 +0000 |
commit | 0a5969c62a75ace6edafd3f7226e96c0d8ba24a6 (patch) | |
tree | 2f4667776c98c1f847937f323645f18da00366f9 /test | |
parent | 7c808170f5bf27b2d4a83ae5934b5e231bb5c1bc (diff) | |
download | ios-node-v8-0a5969c62a75ace6edafd3f7226e96c0d8ba24a6.tar.gz ios-node-v8-0a5969c62a75ace6edafd3f7226e96c0d8ba24a6.tar.bz2 ios-node-v8-0a5969c62a75ace6edafd3f7226e96c0d8ba24a6.zip |
lib: make safe primordials safe to iterate
PR-URL: https://github.com/nodejs/node/pull/36391
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-worker-terminate-source-map.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test/parallel/test-worker-terminate-source-map.js b/test/parallel/test-worker-terminate-source-map.js index 8cd40a6607..c855dab975 100644 --- a/test/parallel/test-worker-terminate-source-map.js +++ b/test/parallel/test-worker-terminate-source-map.js @@ -27,16 +27,19 @@ const { callCount } = workerData; function increaseCallCount() { callCount[0]++; } // Increase the call count when a forbidden method is called. -Object.getPrototypeOf((new Map()).entries()).next = increaseCallCount; -Map.prototype.entries = increaseCallCount; -Object.keys = increaseCallCount; -Object.create = increaseCallCount; -Object.hasOwnProperty = increaseCallCount; for (const property of ['_cache', 'lineLengths', 'url']) { Object.defineProperty(Object.prototype, property, { get: increaseCallCount, set: increaseCallCount }); } +Object.getPrototypeOf([][Symbol.iterator]()).next = increaseCallCount; +Object.getPrototypeOf((new Map()).entries()).next = increaseCallCount; +Array.prototype[Symbol.iterator] = increaseCallCount; +Map.prototype[Symbol.iterator] = increaseCallCount; +Map.prototype.entries = increaseCallCount; +Object.keys = increaseCallCount; +Object.create = increaseCallCount; +Object.hasOwnProperty = increaseCallCount; parentPort.postMessage('done'); |