Skip to content

Commit 8311425

Browse files
committed
test: fixup worker + source map test
The messaging code uses `Object.defineProperty()`, which accesses `value` on `Object.prototype` by default, so some calls to the getter here would actually be expected. Instead, make the list of accessed properties more specific to the tested source map code to avoid flakiness. Refs: https://twitter.com/addaleax/status/1276289101671608320 Refs: #34057 PR-URL: #34446 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 771c3e4 commit 8311425

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/parallel/test-worker-terminate-source-map.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ Map.prototype.entries = increaseCallCount;
3232
Object.keys = increaseCallCount;
3333
Object.create = increaseCallCount;
3434
Object.hasOwnProperty = increaseCallCount;
35-
Object.defineProperty(Object.prototype, 'value', {
36-
get: increaseCallCount,
37-
set: increaseCallCount
38-
});
35+
for (const property of ['_cache', 'lineLengths', 'url']) {
36+
Object.defineProperty(Object.prototype, property, {
37+
get: increaseCallCount,
38+
set: increaseCallCount
39+
});
40+
}
3941

4042
parentPort.postMessage('done');

0 commit comments

Comments
 (0)