| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,10 +27,58 @@ rules: | |||
| 27 | 27 | message: "Use 'overrideStackTrace' from 'lib/internal/errors.js' instead of 'Error.prepareStackTrace'." | |
| 28 | 28 | no-restricted-globals: | |
| 29 | 29 | - error | |
| 30 | - - name: globalThis | ||
| 31 | - message: "Use `const { globalThis } = primordials;` instead of the global." | ||
| 30 | + - name: AbortController | ||
| 31 | + message: "Use `const { AbortController } = require('internal/abort_controller');` instead of the global." | ||
| 32 | + - name: AbortSignal | ||
| 33 | + message: "Use `const { AbortSignal } = require('internal/abort_controller');` instead of the global." | ||
| 34 | + # Atomics is not available in primordials because it can be | ||
| 35 | + # disabled with --no-harmony-atomics CLI flag. | ||
| 36 | + - name: Atomics | ||
| 37 | + message: "Use `const { Atomics } = globalThis;` instead of the global." | ||
| 38 | + - name: Buffer | ||
| 39 | + message: "Use `const { Buffer } = require('buffer');` instead of the global." | ||
| 40 | + - name: Event | ||
| 41 | + message: "Use `const { Event } = require('internal/event_target');` instead of the global." | ||
| 42 | + - name: EventTarget | ||
| 43 | + message: "Use `const { EventTarget } = require('internal/event_target');` instead of the global." | ||
| 44 | + # Intl is not available in primordials because it can be | ||
| 45 | + # disabled with --without-intl build flag. | ||
| 46 | + - name: Intl | ||
| 47 | + message: "Use `const { Intl } = globalThis;` instead of the global." | ||
| 48 | + - name: MessageChannel | ||
| 49 | + message: "Use `const { MessageChannel } = require('internal/worker/io');` instead of the global." | ||
| 50 | + - name: MessageEvent | ||
| 51 | + message: "Use `const { MessageEvent } = require('internal/worker/io');` instead of the global." | ||
| 52 | + - name: MessagePort | ||
| 53 | + message: "Use `const { MessagePort } = require('internal/worker/io');` instead of the global." | ||
| 54 | + # SharedArrayBuffer is not available in primordials because it can be | ||
| 55 | + # disabled with --no-harmony-sharedarraybuffer CLI flag. | ||
| 56 | + - name: SharedArrayBuffer | ||
| 57 | + message: "Use `const { SharedArrayBuffer } = globalThis;` instead of the global." | ||
| 58 | + - name: TextDecoder | ||
| 59 | + message: "Use `const { TextDecoder } = require('internal/encoding');` instead of the global." | ||
| 60 | + - name: TextEncoder | ||
| 61 | + message: "Use `const { TextEncoder } = require('internal/encoding');` instead of the global." | ||
| 62 | + - name: URL | ||
| 63 | + message: "Use `const { URL } = require('internal/url');` instead of the global." | ||
| 64 | + - name: URLSearchParams | ||
| 65 | + message: "Use `const { URLSearchParams } = require('internal/url');` instead of the global." | ||
| 66 | + # WebAssembly is not available in primordials because it can be | ||
| 67 | + # disabled with --jitless CLI flag. | ||
| 68 | + - name: WebAssembly | ||
| 69 | + message: "Use `const { WebAssembly } = globalThis;` instead of the global." | ||
| 70 | + - name: atob | ||
| 71 | + message: "Use `const { atob } = require('buffer');` instead of the global." | ||
| 72 | + - name: btoa | ||
| 73 | + message: "Use `const { btoa } = require('buffer');` instead of the global." | ||
| 32 | 74 | - name: global | |
| 33 | 75 | message: "Use `const { globalThis } = primordials;` instead of `global`." | |
| 76 | + - name: globalThis | ||
| 77 | + message: "Use `const { globalThis } = primordials;` instead of the global." | ||
| 78 | + - name: performance | ||
| 79 | + message: "Use `const { performance } = require('perf_hooks');` instead of the global." | ||
| 80 | + - name: queueMicrotask | ||
| 81 | + message: "Use `const { queueMicrotask } = require('internal/process/task_queues');` instead of the global." | ||
| 34 | 82 | # Custom rules in tools/eslint-rules | |
| 35 | 83 | node-core/lowercase-name-for-primitive: error | |
| 36 | 84 | node-core/non-ascii-character: error | |
@@ -73,6 +121,7 @@ rules: | |||
| 73 | 121 | into: Number | |
| 74 | 122 | - name: parseInt | |
| 75 | 123 | into: Number | |
| 124 | + - name: Proxy | ||
| 76 | 125 | - name: Promise | |
| 77 | 126 | - name: RangeError | |
| 78 | 127 | - name: ReferenceError | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,6 +43,7 @@ let debug = require('internal/util/debuglog').debuglog( | |||
| 43 | 43 | debug = fn; | |
| 44 | 44 | } | |
| 45 | 45 | ); | |
| 46 | + const { AbortController } = require('internal/abort_controller'); | ||
| 46 | 47 | const { Buffer } = require('buffer'); | |
| 47 | 48 | const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap'); | |
| 48 | 49 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,7 +19,7 @@ | |||
| 19 | 19 | // https://github.com/google/caja/blob/HEAD/src/com/google/caja/ses/repairES5.js | |
| 20 | 20 | // https://github.com/tc39/proposal-ses/blob/e5271cc42a257a05dcae2fd94713ed2f46c08620/shim/src/freeze.js | |
| 21 | 21 | ||
| 22 | - /* global WebAssembly, SharedArrayBuffer, console */ | ||
| 22 | + /* global console */ | ||
| 23 | 23 | 'use strict'; | |
| 24 | 24 | ||
| 25 | 25 | const { | |
@@ -73,6 +73,7 @@ const { | |||
| 73 | 73 | ObjectPrototypeHasOwnProperty, | |
| 74 | 74 | Promise, | |
| 75 | 75 | PromisePrototype, | |
| 76 | + Proxy, | ||
| 76 | 77 | RangeError, | |
| 77 | 78 | RangeErrorPrototype, | |
| 78 | 79 | ReferenceError, | |
@@ -111,8 +112,16 @@ const { | |||
| 111 | 112 | decodeURIComponent, | |
| 112 | 113 | encodeURI, | |
| 113 | 114 | encodeURIComponent, | |
| 115 | + globalThis, | ||
| 114 | 116 | } = primordials; | |
| 115 | 117 | ||
| 118 | + const { | ||
| 119 | + Atomics, | ||
| 120 | + Intl, | ||
| 121 | + SharedArrayBuffer, | ||
| 122 | + WebAssembly | ||
| 123 | + } = globalThis; | ||
| 124 | + | ||
| 116 | 125 | module.exports = function() { | |
| 117 | 126 | const { | |
| 118 | 127 | clearImmediate, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,6 +7,7 @@ const { | |||
| 7 | 7 | ObjectCreate, | |
| 8 | 8 | ObjectKeys, | |
| 9 | 9 | ObjectPrototypeHasOwnProperty, | |
| 10 | + Proxy, | ||
| 10 | 11 | ReflectGetPrototypeOf, | |
| 11 | 12 | Symbol, | |
| 12 | 13 | } = primordials; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,6 +12,7 @@ const { | |||
| 12 | 12 | ObjectDefineProperty, | |
| 13 | 13 | ObjectPrototypeHasOwnProperty, | |
| 14 | 14 | Promise, | |
| 15 | + Proxy, | ||
| 15 | 16 | ReflectApply, | |
| 16 | 17 | ReflectGet, | |
| 17 | 18 | ReflectGetPrototypeOf, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,6 +9,7 @@ const { | |||
| 9 | 9 | ArrayPrototypeSplice, | |
| 10 | 10 | ObjectDefineProperty, | |
| 11 | 11 | PromisePrototypeCatch, | |
| 12 | + globalThis: { Atomics }, | ||
| 12 | 13 | } = primordials; | |
| 13 | 14 | ||
| 14 | 15 | const { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,6 +44,7 @@ const { | |||
| 44 | 44 | ObjectPrototype, | |
| 45 | 45 | ObjectPrototypeHasOwnProperty, | |
| 46 | 46 | ObjectSetPrototypeOf, | |
| 47 | + Proxy, | ||
| 47 | 48 | ReflectApply, | |
| 48 | 49 | ReflectSet, | |
| 49 | 50 | RegExpPrototypeTest, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,5 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | ||
| 3 | - /* global WebAssembly */ | ||
| 4 | - | ||
| 5 | 3 | const { | |
| 6 | 4 | ArrayPrototypeMap, | |
| 7 | 5 | Boolean, | |
@@ -19,6 +17,7 @@ const { | |||
| 19 | 17 | StringPrototypeSplit, | |
| 20 | 18 | StringPrototypeStartsWith, | |
| 21 | 19 | SyntaxErrorPrototype, | |
| 20 | + globalThis: { WebAssembly }, | ||
| 22 | 21 | } = primordials; | |
| 23 | 22 | ||
| 24 | 23 | let _TYPES = null; | |
@@ -61,6 +60,7 @@ const experimentalImportMetaResolve = | |||
| 61 | 60 | getOptionValue('--experimental-import-meta-resolve'); | |
| 62 | 61 | const asyncESM = require('internal/process/esm_loader'); | |
| 63 | 62 | const { emitWarningSync } = require('internal/process/warning'); | |
| 63 | + const { TextDecoder } = require('internal/encoding'); | ||
| 64 | 64 | ||
| 65 | 65 | let cjsParse; | |
| 66 | 66 | async function initCJSParse() { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -173,6 +173,7 @@ primordials.SafeWeakSet = makeSafe( | |||
| 173 | 173 | ||
| 174 | 174 | // Create copies of configurable value properties of the global object | |
| 175 | 175 | [ | |
| 176 | + 'Proxy', | ||
| 176 | 177 | 'globalThis', | |
| 177 | 178 | ].forEach((name) => { | |
| 178 | 179 | // eslint-disable-next-line no-restricted-globals | |
@@ -193,7 +194,8 @@ primordials.SafeWeakSet = makeSafe( | |||
| 193 | 194 | [ | |
| 194 | 195 | 'JSON', | |
| 195 | 196 | 'Math', | |
| 196 | - 'Reflect' | ||
| 197 | + 'Proxy', | ||
| 198 | + 'Reflect', | ||
| 197 | 199 | ].forEach((name) => { | |
| 198 | 200 | // eslint-disable-next-line no-restricted-globals | |
| 199 | 201 | copyPropsRenamed(global[name], primordials, name); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,7 +28,7 @@ | |||
| 28 | 28 | 'use strict'; | |
| 29 | 29 | ||
| 30 | 30 | /* eslint-disable node-core/prefer-primordials */ | |
| 31 | - /* global Buffer, console */ | ||
| 31 | + /* global console */ | ||
| 32 | 32 | ||
| 33 | 33 | module.exports = { versionCheck }; | |
| 34 | 34 | ||
@@ -40,6 +40,7 @@ if (module.id === 'internal/v8_prof_polyfill') return; | |||
| 40 | 40 | // Node polyfill | |
| 41 | 41 | const fs = require('fs'); | |
| 42 | 42 | const cp = require('child_process'); | |
| 43 | + const { Buffer } = require('buffer'); | ||
| 43 | 44 | const os = { // eslint-disable-line no-unused-vars | |
| 44 | 45 | system: function(name, args) { | |
| 45 | 46 | if (process.platform === 'linux' && name === 'nm') { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments