Skip to content

Commit 914d6c9

Browse files
committed
lib: use primordials in domexception.js
PR-URL: #27171 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 3da36d0 commit 914d6c9

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/internal/per_context/domexception.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
'use strict';
22

3-
// `per_context` scripts are executed before creating the primordials so we
4-
// cannot use them here.
5-
/* eslint-disable no-restricted-globals */
3+
const {
4+
SafeWeakMap,
5+
SafeMap,
6+
Object,
7+
Symbol
8+
} = primordials;
69

710
class ERR_INVALID_THIS extends TypeError {
811
constructor(type) {
@@ -12,9 +15,9 @@ class ERR_INVALID_THIS extends TypeError {
1215
get code() { return 'ERR_INVALID_THIS'; }
1316
}
1417

15-
const internalsMap = new WeakMap();
18+
const internalsMap = new SafeWeakMap();
1619

17-
const nameToCodeMap = new Map();
20+
const nameToCodeMap = new SafeMap();
1821

1922
class DOMException extends Error {
2023
constructor(message = '', name = 'Error') {

0 commit comments

Comments
 (0)