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:
Joyee Cheung
2019-04-10 16:47:44 +08:00
parent 3da36d0e94
commit 914d6c9ab8

View File

@@ -1,8 +1,11 @@
'use strict';
// `per_context` scripts are executed before creating the primordials so we
// cannot use them here.
/* eslint-disable no-restricted-globals */
const {
SafeWeakMap,
SafeMap,
Object,
Symbol
} = primordials;
class ERR_INVALID_THIS extends TypeError {
constructor(type) {
@@ -12,9 +15,9 @@ class ERR_INVALID_THIS extends TypeError {
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 {
constructor(message = '', name = 'Error') {