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‎

Lines changed: 8 additions & 5 deletions
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
classERR_INVALID_THISextendsTypeError{
811
constructor(type){
@@ -12,9 +15,9 @@ class ERR_INVALID_THIS extends TypeError{
1215
getcode(){return'ERR_INVALID_THIS';}
1316
}
1417

15-
constinternalsMap=newWeakMap();
18+
constinternalsMap=newSafeWeakMap();
1619

17-
constnameToCodeMap=newMap();
20+
constnameToCodeMap=newSafeMap();
1821

1922
classDOMExceptionextendsError{
2023
constructor(message='',name='Error'){

0 commit comments

Comments
(0)