Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 967334b

Browse filesBrowse 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 <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 26c5f9f commit 967334b
Copy full SHA for 967334b

File tree

Expand file treeCollapse file tree

1 file changed

+6
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-4
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-worker-terminate-source-map.js
+6-4Lines changed: 6 additions & 4 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.