From eac3f0adc46c3af0e94d70bb8635440382df7d7f Mon Sep 17 00:00:00 2001 From: Sebastien Ahkrin Date: Sat, 30 Nov 2019 16:55:29 +0100 Subject: [PATCH] lib: replace Symbol global by the primordials Symbol MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/30737 Reviewed-By: Michaƫl Zasso Reviewed-By: Trivikram Kamat Reviewed-By: Colin Ihrig Reviewed-By: Ruben Bridgewater Reviewed-By: Luigi Pinca --- lib/.eslintrc.yaml | 2 ++ lib/_http_agent.js | 1 + lib/_http_common.js | 1 + lib/_http_outgoing.js | 1 + lib/_http_server.js | 1 + lib/_stream_readable.js | 1 + lib/_stream_writable.js | 1 + lib/_tls_wrap.js | 1 + lib/async_hooks.js | 1 + lib/buffer.js | 1 + lib/domain.js | 1 + lib/events.js | 1 + lib/inspector.js | 1 + lib/internal/async_hooks.js | 1 + lib/internal/child_process.js | 1 + lib/internal/child_process/serialization.js | 1 + lib/internal/console/constructor.js | 1 + lib/internal/crypto/hash.js | 1 + lib/internal/crypto/keys.js | 1 + lib/internal/crypto/util.js | 4 ++++ lib/internal/dgram.js | 5 +++++ lib/internal/encoding.js | 1 + lib/internal/errors.js | 1 + lib/internal/freeze_intrinsics.js | 2 +- lib/internal/fs/dir.js | 1 + lib/internal/fs/promises.js | 1 + lib/internal/fs/utils.js | 1 + lib/internal/fs/watchers.js | 1 + lib/internal/http.js | 4 ++++ lib/internal/http2/compat.js | 1 + lib/internal/http2/core.js | 1 + lib/internal/http2/util.js | 1 + lib/internal/js_stream_socket.js | 4 ++++ lib/internal/net.js | 4 ++++ lib/internal/priority_queue.js | 1 + lib/internal/repl/utils.js | 4 ++++ lib/internal/stream_base_commons.js | 1 + lib/internal/streams/async_iterator.js | 1 + lib/internal/streams/buffer_list.js | 4 ++++ lib/internal/streams/duplexpair.js | 5 +++++ lib/internal/streams/from.js | 4 ++++ lib/internal/timers.js | 1 + lib/internal/trace_events_async_hooks.js | 1 + lib/internal/url.js | 1 + lib/internal/util.js | 2 ++ lib/internal/util/comparisons.js | 1 + lib/internal/vm/module.js | 2 +- lib/internal/worker.js | 1 + lib/internal/worker/io.js | 1 + lib/net.js | 1 + lib/os.js | 1 + lib/perf_hooks.js | 1 + lib/readline.js | 1 + lib/repl.js | 1 + lib/string_decoder.js | 1 + lib/trace_events.js | 1 + lib/v8.js | 1 + lib/vm.js | 1 + lib/wasi.js | 4 +++- lib/zlib.js | 1 + 60 files changed, 93 insertions(+), 3 deletions(-) diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index ff9a0f595d2225..0a5197e882b241 100644 --- a/lib/.eslintrc.yaml +++ b/lib/.eslintrc.yaml @@ -23,6 +23,8 @@ rules: message: "Use `const { Object } = primordials;` instead of the global." - name: Reflect message: "Use `const { Reflect } = primordials;` instead of the global." + - name: Symbol + message: "Use `const { Symbol } = primordials;` instead of the global." no-restricted-syntax: # Config copied from .eslintrc.js - error diff --git a/lib/_http_agent.js b/lib/_http_agent.js index af25b2bba75615..69fdb819a3a330 100644 --- a/lib/_http_agent.js +++ b/lib/_http_agent.js @@ -25,6 +25,7 @@ const { ObjectKeys, ObjectSetPrototypeOf, ObjectValues, + Symbol, } = primordials; const net = require('net'); diff --git a/lib/_http_common.js b/lib/_http_common.js index d0f07d3b69e5f5..dc6eba6333c48a 100644 --- a/lib/_http_common.js +++ b/lib/_http_common.js @@ -23,6 +23,7 @@ const { MathMin, + Symbol, } = primordials; const { setImmediate } = require('timers'); diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index c3bfbd09bfca0c..f40cf923f9b377 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -28,6 +28,7 @@ const { ObjectKeys, ObjectPrototypeHasOwnProperty, ObjectSetPrototypeOf, + Symbol, } = primordials; const { getDefaultHighWaterMark } = require('internal/streams/state'); diff --git a/lib/_http_server.js b/lib/_http_server.js index b967cac3ae402d..192d0ddfb7a410 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -24,6 +24,7 @@ const { ObjectKeys, ObjectSetPrototypeOf, + Symbol, } = primordials; const net = require('net'); diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 8f5f66b391293c..6226bbf5eb4063 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -27,6 +27,7 @@ const { NumberIsNaN, ObjectDefineProperty, ObjectSetPrototypeOf, + Symbol, } = primordials; module.exports = Readable; diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js index a9f7164dc73b13..0e0d87ae1d198d 100644 --- a/lib/_stream_writable.js +++ b/lib/_stream_writable.js @@ -29,6 +29,7 @@ const { Array, ObjectDefineProperty, ObjectSetPrototypeOf, + Symbol, } = primordials; module.exports = Writable; diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 4379287cc4775c..2a534694566bfa 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -25,6 +25,7 @@ const { ObjectAssign, ObjectDefineProperty, ObjectSetPrototypeOf, + Symbol, } = primordials; const { diff --git a/lib/async_hooks.js b/lib/async_hooks.js index a7ca5af7ef8105..be32f6d1102bbd 100644 --- a/lib/async_hooks.js +++ b/lib/async_hooks.js @@ -3,6 +3,7 @@ const { NumberIsSafeInteger, ReflectApply, + Symbol, } = primordials; const { diff --git a/lib/buffer.js b/lib/buffer.js index 8cbc0af538dbba..e318efc6540165 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -34,6 +34,7 @@ const { ObjectDefineProperties, ObjectDefineProperty, ObjectSetPrototypeOf, + Symbol, } = primordials; const { diff --git a/lib/domain.js b/lib/domain.js index 322e7eb9586c35..4f340f20ec34c3 100644 --- a/lib/domain.js +++ b/lib/domain.js @@ -30,6 +30,7 @@ const { Array, ObjectDefineProperty, ReflectApply, + Symbol, } = primordials; const EventEmitter = require('events'); diff --git a/lib/events.js b/lib/events.js index ce93cd9f9bfd3e..203a20ed8057cd 100644 --- a/lib/events.js +++ b/lib/events.js @@ -32,6 +32,7 @@ const { ObjectKeys, ReflectApply, ReflectOwnKeys, + Symbol, } = primordials; const kRejection = Symbol.for('nodejs.rejection'); diff --git a/lib/inspector.js b/lib/inspector.js index b2bad040ceae79..203cd739a7ac06 100644 --- a/lib/inspector.js +++ b/lib/inspector.js @@ -3,6 +3,7 @@ const { JSONParse, JSONStringify, + Symbol, } = primordials; const { diff --git a/lib/internal/async_hooks.js b/lib/internal/async_hooks.js index b17406c78241cd..bf5456a858870f 100644 --- a/lib/internal/async_hooks.js +++ b/lib/internal/async_hooks.js @@ -4,6 +4,7 @@ const { FunctionPrototypeBind, NumberIsSafeInteger, ObjectDefineProperty, + Symbol, } = primordials; const { diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index 3836ee8e3d5ef5..b07a38d6f6f5ac 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -4,6 +4,7 @@ const { ArrayIsArray, ObjectDefineProperty, ObjectSetPrototypeOf, + Symbol, } = primordials; const { diff --git a/lib/internal/child_process/serialization.js b/lib/internal/child_process/serialization.js index 48b6d7ffe00bf6..9f03a8e8446c43 100644 --- a/lib/internal/child_process/serialization.js +++ b/lib/internal/child_process/serialization.js @@ -3,6 +3,7 @@ const { JSONParse, JSONStringify, + Symbol, } = primordials; const { Buffer } = require('buffer'); const { StringDecoder } = require('string_decoder'); diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js index 76b2066e9b7fd0..85b88a72ea9290 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.js @@ -15,6 +15,7 @@ const { ObjectPrototypeHasOwnProperty, ObjectValues, ReflectOwnKeys, + Symbol, } = primordials; const { trace } = internalBinding('trace_events'); diff --git a/lib/internal/crypto/hash.js b/lib/internal/crypto/hash.js index 56784275f9c0d2..dca0ba767f6e29 100644 --- a/lib/internal/crypto/hash.js +++ b/lib/internal/crypto/hash.js @@ -2,6 +2,7 @@ const { ObjectSetPrototypeOf, + Symbol, } = primordials; const { diff --git a/lib/internal/crypto/keys.js b/lib/internal/crypto/keys.js index 25ef8884953bc9..087cef014f0fb1 100644 --- a/lib/internal/crypto/keys.js +++ b/lib/internal/crypto/keys.js @@ -2,6 +2,7 @@ const { ObjectDefineProperty, + Symbol, } = primordials; const { diff --git a/lib/internal/crypto/util.js b/lib/internal/crypto/util.js index 8bf66e9cdf3268..286efc39a61e4f 100644 --- a/lib/internal/crypto/util.js +++ b/lib/internal/crypto/util.js @@ -1,5 +1,9 @@ 'use strict'; +const { + Symbol, +} = primordials; + const { getCiphers: _getCiphers, getCurves: _getCurves, diff --git a/lib/internal/dgram.js b/lib/internal/dgram.js index 0c0fefa27c1225..8a8d9ba8c0ddd4 100644 --- a/lib/internal/dgram.js +++ b/lib/internal/dgram.js @@ -1,4 +1,9 @@ 'use strict'; + +const { + Symbol, +} = primordials; + const { codes } = require('internal/errors'); const { UDP } = internalBinding('udp_wrap'); const { guessHandleType } = internalBinding('util'); diff --git a/lib/internal/encoding.js b/lib/internal/encoding.js index fe940f6e860497..c053a3cfa317c9 100644 --- a/lib/internal/encoding.js +++ b/lib/internal/encoding.js @@ -7,6 +7,7 @@ const { ObjectCreate, ObjectDefineProperties, ObjectGetOwnPropertyDescriptors, + Symbol, } = primordials; const { diff --git a/lib/internal/errors.js b/lib/internal/errors.js index 8e6962e25645ea..f76fe328c214bb 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -16,6 +16,7 @@ const { NumberIsInteger, ObjectDefineProperty, ObjectKeys, + Symbol, } = primordials; const messages = new Map(); diff --git a/lib/internal/freeze_intrinsics.js b/lib/internal/freeze_intrinsics.js index 6135c3090dac25..60fff67f2e100c 100644 --- a/lib/internal/freeze_intrinsics.js +++ b/lib/internal/freeze_intrinsics.js @@ -31,7 +31,7 @@ module.exports = function() { getOwnPropertyDescriptors, getOwnPropertyNames, getOwnPropertySymbols, - getPrototypeOf + getPrototypeOf, } = Object; const objectHasOwnProperty = Object.prototype.hasOwnProperty; const { ownKeys } = Reflect; diff --git a/lib/internal/fs/dir.js b/lib/internal/fs/dir.js index c4e0a3746c125a..749e22ee696c6f 100644 --- a/lib/internal/fs/dir.js +++ b/lib/internal/fs/dir.js @@ -2,6 +2,7 @@ const { ObjectDefineProperty, + Symbol, } = primordials; const pathModule = require('path'); diff --git a/lib/internal/fs/promises.js b/lib/internal/fs/promises.js index daf18e19d1c784..cc3f98268c7e55 100644 --- a/lib/internal/fs/promises.js +++ b/lib/internal/fs/promises.js @@ -4,6 +4,7 @@ const { MathMax, MathMin, NumberIsSafeInteger, + Symbol, } = primordials; const { diff --git a/lib/internal/fs/utils.js b/lib/internal/fs/utils.js index 951030c5a50bd1..ac258bdb112876 100644 --- a/lib/internal/fs/utils.js +++ b/lib/internal/fs/utils.js @@ -7,6 +7,7 @@ const { NumberIsFinite, ObjectSetPrototypeOf, ReflectOwnKeys, + Symbol, } = primordials; const { Buffer } = require('buffer'); diff --git a/lib/internal/fs/watchers.js b/lib/internal/fs/watchers.js index c94739d718e44b..59f8bfcebcd2e3 100644 --- a/lib/internal/fs/watchers.js +++ b/lib/internal/fs/watchers.js @@ -3,6 +3,7 @@ const { ObjectDefineProperty, ObjectSetPrototypeOf, + Symbol, } = primordials; const errors = require('internal/errors'); diff --git a/lib/internal/http.js b/lib/internal/http.js index 09294888be5e70..aab4170a2f0e06 100644 --- a/lib/internal/http.js +++ b/lib/internal/http.js @@ -1,5 +1,9 @@ 'use strict'; +const { + Symbol, +} = primordials; + const { setUnrefTimeout } = require('internal/timers'); const { PerformanceEntry, notify } = internalBinding('performance'); diff --git a/lib/internal/http2/compat.js b/lib/internal/http2/compat.js index 6a55b4edd19311..94282cc4bb572a 100644 --- a/lib/internal/http2/compat.js +++ b/lib/internal/http2/compat.js @@ -8,6 +8,7 @@ const { ObjectKeys, ObjectPrototypeHasOwnProperty, ReflectGetPrototypeOf, + Symbol, } = primordials; const assert = require('internal/assert'); diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index 167044f8408fee..b48e405b8dec96 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -11,6 +11,7 @@ const { ObjectDefineProperty, ObjectPrototypeHasOwnProperty, ReflectGetPrototypeOf, + Symbol, } = primordials; const { diff --git a/lib/internal/http2/util.js b/lib/internal/http2/util.js index d97ce2f13f0306..3bf3a8fdd56df9 100644 --- a/lib/internal/http2/util.js +++ b/lib/internal/http2/util.js @@ -6,6 +6,7 @@ const { Number, ObjectCreate, ObjectKeys, + Symbol, } = primordials; const binding = internalBinding('http2'); diff --git a/lib/internal/js_stream_socket.js b/lib/internal/js_stream_socket.js index 7c35a55b1c9455..1a805ae830bdb2 100644 --- a/lib/internal/js_stream_socket.js +++ b/lib/internal/js_stream_socket.js @@ -1,5 +1,9 @@ 'use strict'; +const { + Symbol, +} = primordials; + const { setImmediate } = require('timers'); const assert = require('internal/assert'); const { Socket } = require('net'); diff --git a/lib/internal/net.js b/lib/internal/net.js index bbdc9bf8437c39..5f6e476b58295d 100644 --- a/lib/internal/net.js +++ b/lib/internal/net.js @@ -1,5 +1,9 @@ 'use strict'; +const { + Symbol, +} = primordials; + const Buffer = require('buffer').Buffer; const { writeBuffer } = internalBinding('fs'); const errors = require('internal/errors'); diff --git a/lib/internal/priority_queue.js b/lib/internal/priority_queue.js index afd2cef643b9e5..c31c1eea385857 100644 --- a/lib/internal/priority_queue.js +++ b/lib/internal/priority_queue.js @@ -2,6 +2,7 @@ const { Array, + Symbol, } = primordials; const kCompare = Symbol('compare'); diff --git a/lib/internal/repl/utils.js b/lib/internal/repl/utils.js index d60b33208883d4..6c011e8533f8c3 100644 --- a/lib/internal/repl/utils.js +++ b/lib/internal/repl/utils.js @@ -1,5 +1,9 @@ 'use strict'; +const { + Symbol, +} = primordials; + const acorn = require('internal/deps/acorn/acorn/dist/acorn'); const privateMethods = require('internal/deps/acorn-plugins/acorn-private-methods/index'); diff --git a/lib/internal/stream_base_commons.js b/lib/internal/stream_base_commons.js index 504de5fc57f9ab..800ba4cefd6370 100644 --- a/lib/internal/stream_base_commons.js +++ b/lib/internal/stream_base_commons.js @@ -2,6 +2,7 @@ const { Array, + Symbol, } = primordials; const { Buffer } = require('buffer'); diff --git a/lib/internal/streams/async_iterator.js b/lib/internal/streams/async_iterator.js index e05813e5dfd947..a6b8bd9d181c38 100644 --- a/lib/internal/streams/async_iterator.js +++ b/lib/internal/streams/async_iterator.js @@ -4,6 +4,7 @@ const { ObjectCreate, ObjectGetPrototypeOf, ObjectSetPrototypeOf, + Symbol, } = primordials; const finished = require('internal/streams/end-of-stream'); diff --git a/lib/internal/streams/buffer_list.js b/lib/internal/streams/buffer_list.js index 5e23f2cf464f6c..c7adc5b0731579 100644 --- a/lib/internal/streams/buffer_list.js +++ b/lib/internal/streams/buffer_list.js @@ -1,5 +1,9 @@ 'use strict'; +const { + Symbol, +} = primordials; + const { Buffer } = require('buffer'); const { inspect } = require('internal/util/inspect'); diff --git a/lib/internal/streams/duplexpair.js b/lib/internal/streams/duplexpair.js index 6735bcb2b92531..ec92cbe8716df4 100644 --- a/lib/internal/streams/duplexpair.js +++ b/lib/internal/streams/duplexpair.js @@ -1,4 +1,9 @@ 'use strict'; + +const { + Symbol, +} = primordials; + const { Duplex } = require('stream'); const kCallback = Symbol('Callback'); diff --git a/lib/internal/streams/from.js b/lib/internal/streams/from.js index e809f2658d5a9a..7e1c2fbb19df6b 100644 --- a/lib/internal/streams/from.js +++ b/lib/internal/streams/from.js @@ -1,5 +1,9 @@ 'use strict'; +const { + Symbol, +} = primordials; + const { ERR_INVALID_ARG_TYPE } = require('internal/errors').codes; diff --git a/lib/internal/timers.js b/lib/internal/timers.js index 84b3c34d87cfaf..1b6422f41ea7af 100644 --- a/lib/internal/timers.js +++ b/lib/internal/timers.js @@ -77,6 +77,7 @@ const { MathTrunc, NumberMIN_SAFE_INTEGER, ObjectCreate, + Symbol, } = primordials; const { diff --git a/lib/internal/trace_events_async_hooks.js b/lib/internal/trace_events_async_hooks.js index 87ee63d8ba7426..84c7745e47368f 100644 --- a/lib/internal/trace_events_async_hooks.js +++ b/lib/internal/trace_events_async_hooks.js @@ -4,6 +4,7 @@ const { ObjectKeys, SafeMap, SafeSet, + Symbol, } = primordials; const { trace } = internalBinding('trace_events'); diff --git a/lib/internal/url.js b/lib/internal/url.js index 3c75baf27b0973..54b9a18cafb549 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -11,6 +11,7 @@ const { ObjectKeys, ReflectGetOwnPropertyDescriptor, ReflectOwnKeys, + Symbol, } = primordials; const { inspect } = require('internal/util/inspect'); diff --git a/lib/internal/util.js b/lib/internal/util.js index 0a319739187fab..526d2504eaf462 100644 --- a/lib/internal/util.js +++ b/lib/internal/util.js @@ -11,7 +11,9 @@ const { ObjectGetPrototypeOf, ObjectSetPrototypeOf, ReflectConstruct, + Symbol, } = primordials; + const { codes: { ERR_INVALID_ARG_TYPE, diff --git a/lib/internal/util/comparisons.js b/lib/internal/util/comparisons.js index b26012923c80c5..b27b0bf7cee512 100644 --- a/lib/internal/util/comparisons.js +++ b/lib/internal/util/comparisons.js @@ -15,6 +15,7 @@ const { ObjectPrototypePropertyIsEnumerable, ObjectPrototypeToString, StringPrototypeValueOf, + Symbol, SymbolPrototypeValueOf, } = primordials; diff --git a/lib/internal/vm/module.js b/lib/internal/vm/module.js index ee2fec2e431380..9e6aa6b6b870ae 100644 --- a/lib/internal/vm/module.js +++ b/lib/internal/vm/module.js @@ -5,8 +5,8 @@ const { ArrayIsArray, ObjectCreate, ObjectDefineProperty, - Symbol, SafePromise, + Symbol, } = primordials; const { isContext } = internalBinding('contextify'); diff --git a/lib/internal/worker.js b/lib/internal/worker.js index fb033b24729479..6051a021785dde 100644 --- a/lib/internal/worker.js +++ b/lib/internal/worker.js @@ -7,6 +7,7 @@ const { MathMax, ObjectCreate, ObjectEntries, + Symbol, } = primordials; const EventEmitter = require('events'); diff --git a/lib/internal/worker/io.js b/lib/internal/worker/io.js index a672dac94ce7e5..1167198676b01b 100644 --- a/lib/internal/worker/io.js +++ b/lib/internal/worker/io.js @@ -7,6 +7,7 @@ const { ObjectGetOwnPropertyDescriptors, ObjectGetPrototypeOf, ObjectSetPrototypeOf, + Symbol, } = primordials; const { diff --git a/lib/net.js b/lib/net.js index 7e5d0ea621dedc..5f12c733dd4422 100644 --- a/lib/net.js +++ b/lib/net.js @@ -28,6 +28,7 @@ const { NumberIsNaN, ObjectDefineProperty, ObjectSetPrototypeOf, + Symbol, } = primordials; const EventEmitter = require('events'); diff --git a/lib/os.js b/lib/os.js index 51520802d8ecf7..29b2946b80f428 100644 --- a/lib/os.js +++ b/lib/os.js @@ -23,6 +23,7 @@ const { ObjectDefineProperties, + Symbol, } = primordials; const { safeGetenv } = internalBinding('credentials'); diff --git a/lib/perf_hooks.js b/lib/perf_hooks.js index 0b8bab03e48296..3e86f10e222441 100644 --- a/lib/perf_hooks.js +++ b/lib/perf_hooks.js @@ -7,6 +7,7 @@ const { ObjectDefineProperties, ObjectDefineProperty, ObjectKeys, + Symbol, } = primordials; const { diff --git a/lib/readline.js b/lib/readline.js index 630359aeb643fc..ea53cd1bbf80c8 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -36,6 +36,7 @@ const { NumberIsNaN, ObjectDefineProperty, ObjectSetPrototypeOf, + Symbol, } = primordials; const { diff --git a/lib/repl.js b/lib/repl.js index 55daf2f47f6337..b6876bb8c6013c 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -55,6 +55,7 @@ const { ObjectKeys, ObjectPrototypeHasOwnProperty, ObjectSetPrototypeOf, + Symbol, } = primordials; const { diff --git a/lib/string_decoder.js b/lib/string_decoder.js index 0ab74b772559c4..3d2cc2fcb6ab51 100644 --- a/lib/string_decoder.js +++ b/lib/string_decoder.js @@ -24,6 +24,7 @@ const { ArrayBufferIsView, ObjectDefineProperties, + Symbol, } = primordials; const { Buffer } = require('buffer'); diff --git a/lib/trace_events.js b/lib/trace_events.js index 5ec50d32c63424..1ff2b5a4fb1515 100644 --- a/lib/trace_events.js +++ b/lib/trace_events.js @@ -2,6 +2,7 @@ const { ArrayIsArray, + Symbol, } = primordials; const { hasTracing } = internalBinding('config'); diff --git a/lib/v8.js b/lib/v8.js index 1e0ee43f224c8f..cabe96f345293c 100644 --- a/lib/v8.js +++ b/lib/v8.js @@ -17,6 +17,7 @@ const { Array, ObjectPrototypeToString, + Symbol, } = primordials; const { Buffer } = require('buffer'); diff --git a/lib/vm.js b/lib/vm.js index d12a460df69c39..a4b5b37e83cf28 100644 --- a/lib/vm.js +++ b/lib/vm.js @@ -24,6 +24,7 @@ const { ArrayIsArray, ArrayPrototypeForEach, + Symbol, } = primordials; const { diff --git a/lib/wasi.js b/lib/wasi.js index 65b8473624198c..ff8685cbb06452 100644 --- a/lib/wasi.js +++ b/lib/wasi.js @@ -5,8 +5,10 @@ const { ArrayPrototypeForEach, ArrayPrototypeMap, FunctionPrototypeBind, - ObjectKeys + ObjectKeys, + Symbol, } = primordials; + const { ERR_INVALID_ARG_TYPE, ERR_WASI_ALREADY_STARTED diff --git a/lib/zlib.js b/lib/zlib.js index 375af0fea5a429..3b9e522a06c7e5 100644 --- a/lib/zlib.js +++ b/lib/zlib.js @@ -31,6 +31,7 @@ const { ObjectGetPrototypeOf, ObjectKeys, ObjectSetPrototypeOf, + Symbol, } = primordials; const {