url: ensure getter access do not mutate observable symbols

PR-URL: https://github.com/nodejs/node/pull/48897
Refs: https://github.com/nodejs/node/pull/48891
Refs: https://github.com/nodejs/node/issues/48886
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
This commit is contained in:
Antoine du Hamel authored and GitHub committed 2023-07-24 07:47:47 +00:00
1 parent 1ceb8c113d
commit ad0603edc6
1 file changed
+2
@@ -16,7 +16,9 @@ const normalizedValues = ['a', '1', 'true', 'undefined', 'null', '\uFFFD',
'[object Object]'];
const m = new URL('http://example.org');
const ownSymbolsBeforeGetterAccess = Object.getOwnPropertySymbols(m);
const sp = m.searchParams;
assert.deepStrictEqual(Object.getOwnPropertySymbols(m), ownSymbolsBeforeGetterAccess);
assert(sp);
assert.strictEqual(sp.toString(), '');