Skip to content

Commit

Permalink
lib: use primordials in domexception.js
Browse files Browse the repository at this point in the history
PR-URL: #27171
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
joyeecheung committed Apr 13, 2019
1 parent 3da36d0 commit 914d6c9
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/internal/per_context/domexception.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand All @@ -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') {
Expand Down

0 comments on commit 914d6c9

Please sign in to comment.