lib: use primordials in domexception.js
PR-URL: https://github.com/nodejs/node/pull/27171 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
3da36d0e94
commit
914d6c9ab8
@ -1,8 +1,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
// `per_context` scripts are executed before creating the primordials so we
|
const {
|
||||||
// cannot use them here.
|
SafeWeakMap,
|
||||||
/* eslint-disable no-restricted-globals */
|
SafeMap,
|
||||||
|
Object,
|
||||||
|
Symbol
|
||||||
|
} = primordials;
|
||||||
|
|
||||||
class ERR_INVALID_THIS extends TypeError {
|
class ERR_INVALID_THIS extends TypeError {
|
||||||
constructor(type) {
|
constructor(type) {
|
||||||
@ -12,9 +15,9 @@ class ERR_INVALID_THIS extends TypeError {
|
|||||||
get code() { return 'ERR_INVALID_THIS'; }
|
get code() { return 'ERR_INVALID_THIS'; }
|
||||||
}
|
}
|
||||||
|
|
||||||
const internalsMap = new WeakMap();
|
const internalsMap = new SafeWeakMap();
|
||||||
|
|
||||||
const nameToCodeMap = new Map();
|
const nameToCodeMap = new SafeMap();
|
||||||
|
|
||||||
class DOMException extends Error {
|
class DOMException extends Error {
|
||||||
constructor(message = '', name = 'Error') {
|
constructor(message = '', name = 'Error') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user