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: https://github.com/nodejs/node/pull/34057

PR-URL: https://github.com/nodejs/node/pull/34446
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Anna Henningsen authored and Myles Borins committed 2020-07-27 18:13:05 -04:00
1 parent cd35d00518
commit 4e2f5fa907
1 file changed
+6 -4
@@ -32,9 +32,11 @@ Map.prototype.entries = increaseCallCount;
Object.keys = increaseCallCount;
Object.create = increaseCallCount;
Object.hasOwnProperty = increaseCallCount;
Object.defineProperty(Object.prototype, 'value', {
get: increaseCallCount,
set: increaseCallCount
});
for (const property of ['_cache', 'lineLengths', 'url']) {
Object.defineProperty(Object.prototype, property, {
get: increaseCallCount,
set: increaseCallCount
});
}
parentPort.postMessage('done');