| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,16 +27,65 @@ 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 | |
| 37 | 85 | node-core/no-array-destructuring: error | |
| 38 | 86 | node-core/prefer-primordials: | |
| 39 | 87 | - error | |
| 88 | + - name: AggregateError | ||
| 40 | 89 | - name: Array | |
| 41 | 90 | - name: ArrayBuffer | |
| 42 | 91 | - name: BigInt | |
@@ -76,6 +125,7 @@ rules: | |||
| 76 | 125 | into: Number | |
| 77 | 126 | - name: parseInt | |
| 78 | 127 | into: Number | |
| 128 | + - name: Proxy | ||
| 79 | 129 | - name: Promise | |
| 80 | 130 | - name: RangeError | |
| 81 | 131 | - name: ReferenceError | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,6 +20,8 @@ const { | |||
| 20 | 20 | FixedSizeBlobCopyJob, | |
| 21 | 21 | } = internalBinding('buffer'); | |
| 22 | 22 | ||
| 23 | + const { TextDecoder } = require('internal/encoding'); | ||
| 24 | + | ||
| 23 | 25 | const { | |
| 24 | 26 | JSTransferable, | |
| 25 | 27 | kClone, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -46,6 +46,7 @@ const { | |||
| 46 | 46 | ObjectGetPrototypeOf, | |
| 47 | 47 | ObjectPreventExtensions, | |
| 48 | 48 | ObjectSetPrototypeOf, | |
| 49 | + Proxy, | ||
| 49 | 50 | ReflectGet, | |
| 50 | 51 | ReflectSet, | |
| 51 | 52 | SymbolToStringTag, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,7 +26,7 @@ const { | |||
| 26 | 26 | validateString, | |
| 27 | 27 | } = require('internal/validators'); | |
| 28 | 28 | ||
| 29 | - const { TextDecoder } = require('internal/encoding'); | ||
| 29 | + const { TextDecoder, TextEncoder } = require('internal/encoding'); | ||
| 30 | 30 | ||
| 31 | 31 | const { | |
| 32 | 32 | codes: { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,7 +19,7 @@ | |||
| 19 | 19 | // https://github.com/google/caja/blob/master/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 { | |
@@ -78,6 +78,7 @@ const { | |||
| 78 | 78 | ObjectPrototypeHasOwnProperty, | |
| 79 | 79 | Promise, | |
| 80 | 80 | PromisePrototype, | |
| 81 | + Proxy, | ||
| 81 | 82 | RangeError, | |
| 82 | 83 | RangeErrorPrototype, | |
| 83 | 84 | ReferenceError, | |
@@ -124,6 +125,13 @@ const { | |||
| 124 | 125 | globalThis, | |
| 125 | 126 | } = primordials; | |
| 126 | 127 | ||
| 128 | + const { | ||
| 129 | + Atomics, | ||
| 130 | + Intl, | ||
| 131 | + SharedArrayBuffer, | ||
| 132 | + WebAssembly | ||
| 133 | + } = globalThis; | ||
| 134 | + | ||
| 127 | 135 | module.exports = function() { | |
| 128 | 136 | const { | |
| 129 | 137 | clearImmediate, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,6 +9,7 @@ const { | |||
| 9 | 9 | ObjectCreate, | |
| 10 | 10 | ObjectKeys, | |
| 11 | 11 | ObjectPrototypeHasOwnProperty, | |
| 12 | + Proxy, | ||
| 12 | 13 | ReflectApply, | |
| 13 | 14 | ReflectGetPrototypeOf, | |
| 14 | 15 | StringPrototypeIncludes, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,6 +18,7 @@ const { | |||
| 18 | 18 | ObjectPrototypeHasOwnProperty, | |
| 19 | 19 | Promise, | |
| 20 | 20 | PromisePrototypeCatch, | |
| 21 | + Proxy, | ||
| 21 | 22 | ReflectApply, | |
| 22 | 23 | ReflectGet, | |
| 23 | 24 | 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 | |
|---|---|---|---|
@@ -45,6 +45,7 @@ const { | |||
| 45 | 45 | ObjectPrototype, | |
| 46 | 46 | ObjectPrototypeHasOwnProperty, | |
| 47 | 47 | ObjectSetPrototypeOf, | |
| 48 | + Proxy, | ||
| 48 | 49 | ReflectApply, | |
| 49 | 50 | ReflectSet, | |
| 50 | 51 | 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 | ArrayPrototypeForEach, | |
| 7 | 5 | ArrayPrototypeMap, | |
@@ -21,6 +19,7 @@ const { | |||
| 21 | 19 | StringPrototypeSplit, | |
| 22 | 20 | StringPrototypeStartsWith, | |
| 23 | 21 | SyntaxErrorPrototype, | |
| 22 | + globalThis: { WebAssembly }, | ||
| 24 | 23 | } = primordials; | |
| 25 | 24 | ||
| 26 | 25 | let _TYPES = null; | |
@@ -63,6 +62,7 @@ const experimentalImportMetaResolve = | |||
| 63 | 62 | getOptionValue('--experimental-import-meta-resolve'); | |
| 64 | 63 | const asyncESM = require('internal/process/esm_loader'); | |
| 65 | 64 | const { emitWarningSync } = require('internal/process/warning'); | |
| 65 | + const { TextDecoder } = require('internal/encoding'); | ||
| 66 | 66 | ||
| 67 | 67 | let cjsParse; | |
| 68 | 68 | async function initCJSParse() { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments