Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2019-04-10 11:47:44 +0300
committerJoyee Cheung <joyeec9h3@gmail.com>2019-04-13 12:53:27 +0300
commit914d6c9ab8cd7154c075867f3894bd90b8e252ea (patch)
treec34e6d71def8c9ab43b0b85aba26b75af86a6c96 /lib/internal/per_context
parent3da36d0e94987dc6594fdffc3678d3f970cdac75 (diff)
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>
Diffstat (limited to 'lib/internal/per_context')
-rw-r--r--lib/internal/per_context/domexception.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/internal/per_context/domexception.js b/lib/internal/per_context/domexception.js
index 729fe3757ad..83b8d559952 100644
--- a/lib/internal/per_context/domexception.js
+++ b/lib/internal/per_context/domexception.js
@@ -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') {