| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 99b7382 commit 6b09d30
17 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1133,7 +1133,7 @@ exports = { hello: false }; // Not exported, only available in the module | |||
| 1133 | 1133 | When the `module.exports` property is being completely replaced by a new | |
| 1134 | 1134 | object, it is common to also reassign `exports`: | |
| 1135 | 1135 | ||
| 1136 | - <!-- eslint-disable func-name-matching --> | ||
| 1136 | + <!-- eslint-disable node-core/func-name-matching --> | ||
| 1137 | 1137 | ||
| 1138 | 1138 | ```js | |
| 1139 | 1139 | module.exports = exports = function Constructor() { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -176,7 +176,6 @@ export default [ | |||
| 176 | 176 | 'default-case-last': 'error', | |
| 177 | 177 | 'dot-notation': 'error', | |
| 178 | 178 | 'eqeqeq': ['error', 'smart'], | |
| 179 | - 'func-name-matching': 'error', | ||
| 180 | 179 | 'func-style': ['error', 'declaration', { allowArrowFunctions: true }], | |
| 181 | 180 | 'no-constant-condition': ['error', { checkLoops: false }], | |
| 182 | 181 | 'no-constructor-return': 'error', | |
@@ -388,6 +387,7 @@ export default [ | |||
| 388 | 387 | 'node-core/no-duplicate-requires': 'error', | |
| 389 | 388 | 'node-core/prefer-proto': 'error', | |
| 390 | 389 | 'node-core/prefer-optional-chaining': 'error', | |
| 390 | + 'node-core/func-name-matching': ['error', { considerPropertyDescriptor: true }], | ||
| 391 | 391 | }, | |
| 392 | 392 | }, | |
| 393 | 393 | // #endregion | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -267,7 +267,7 @@ function exists(path, callback) { | |||
| 267 | 267 | ||
| 268 | 268 | ObjectDefineProperty(exists, kCustomPromisifiedSymbol, { | |
| 269 | 269 | __proto__: null, | |
| 270 | - value: function exists(path) { // eslint-disable-line func-name-matching | ||
| 270 | + value: function exists(path) { | ||
| 271 | 271 | return new Promise((resolve) => fs.exists(path, resolve)); | |
| 272 | 272 | }, | |
| 273 | 273 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -75,7 +75,7 @@ ObjectDefineProperty(globalThis, 'fetch', { | |||
| 75 | 75 | configurable: true, | |
| 76 | 76 | enumerable: true, | |
| 77 | 77 | writable: true, | |
| 78 | - value: function fetch(input, init = undefined) { // eslint-disable-line func-name-matching | ||
| 78 | + value: function fetch(input, init = undefined) { | ||
| 79 | 79 | if (!fetchImpl) { // Implement lazy loading of undici module for fetch function | |
| 80 | 80 | const undiciModule = require('internal/deps/undici/undici'); | |
| 81 | 81 | fetchImpl = undiciModule.fetch; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -51,6 +51,7 @@ const { | |||
| 51 | 51 | } = require('internal/validators'); | |
| 52 | 52 | const { previewEntries } = internalBinding('util'); | |
| 53 | 53 | const { Buffer: { isBuffer } } = require('buffer'); | |
| 54 | + const { assignFunctionName } = require('internal/util'); | ||
| 54 | 55 | const { | |
| 55 | 56 | inspect, | |
| 56 | 57 | formatWithOptions, | |
@@ -182,9 +183,9 @@ const consolePropAttributes = { | |||
| 182 | 183 | // Fixup global.console instanceof global.console.Console | |
| 183 | 184 | ObjectDefineProperty(Console, SymbolHasInstance, { | |
| 184 | 185 | __proto__: null, | |
| 185 | - value(instance) { | ||
| 186 | + value: assignFunctionName(SymbolHasInstance, function(instance) { | ||
| 186 | 187 | return instance[kIsConsole]; | |
| 187 | - }, | ||
| 188 | + }), | ||
| 188 | 189 | }); | |
| 189 | 190 | ||
| 190 | 191 | const kColorInspectOptions = { colors: true }; | |
@@ -197,19 +198,19 @@ ObjectDefineProperties(Console.prototype, { | |||
| 197 | 198 | __proto__: null, | |
| 198 | 199 | ...consolePropAttributes, | |
| 199 | 200 | // Eager version for the Console constructor | |
| 200 | - value: function(stdout, stderr) { | ||
| 201 | + value: assignFunctionName(kBindStreamsEager, function(stdout, stderr) { | ||
| 201 | 202 | ObjectDefineProperties(this, { | |
| 202 | 203 | '_stdout': { __proto__: null, ...consolePropAttributes, value: stdout }, | |
| 203 | 204 | '_stderr': { __proto__: null, ...consolePropAttributes, value: stderr }, | |
| 204 | 205 | }); | |
| 205 | - }, | ||
| 206 | + }), | ||
| 206 | 207 | }, | |
| 207 | 208 | [kBindStreamsLazy]: { | |
| 208 | 209 | __proto__: null, | |
| 209 | 210 | ...consolePropAttributes, | |
| 210 | 211 | // Lazily load the stdout and stderr from an object so we don't | |
| 211 | 212 | // create the stdio streams when they are not even accessed | |
| 212 | - value: function(object) { | ||
| 213 | + value: assignFunctionName(kBindStreamsLazy, function(object) { | ||
| 213 | 214 | let stdout; | |
| 214 | 215 | let stderr; | |
| 215 | 216 | ObjectDefineProperties(this, { | |
@@ -232,12 +233,12 @@ ObjectDefineProperties(Console.prototype, { | |||
| 232 | 233 | set(value) { stderr = value; }, | |
| 233 | 234 | }, | |
| 234 | 235 | }); | |
| 235 | - }, | ||
| 236 | + }), | ||
| 236 | 237 | }, | |
| 237 | 238 | [kBindProperties]: { | |
| 238 | 239 | __proto__: null, | |
| 239 | 240 | ...consolePropAttributes, | |
| 240 | - value: function(ignoreErrors, colorMode, groupIndentation = 2) { | ||
| 241 | + value: assignFunctionName(kBindProperties, function(ignoreErrors, colorMode, groupIndentation = 2) { | ||
| 241 | 242 | ObjectDefineProperties(this, { | |
| 242 | 243 | '_stdoutErrorHandler': { | |
| 243 | 244 | __proto__: null, | |
@@ -277,12 +278,12 @@ ObjectDefineProperties(Console.prototype, { | |||
| 277 | 278 | value: 'console', | |
| 278 | 279 | }, | |
| 279 | 280 | }); | |
| 280 | - }, | ||
| 281 | + }), | ||
| 281 | 282 | }, | |
| 282 | 283 | [kWriteToConsole]: { | |
| 283 | 284 | __proto__: null, | |
| 284 | 285 | ...consolePropAttributes, | |
| 285 | - value: function(streamSymbol, string) { | ||
| 286 | + value: assignFunctionName(kWriteToConsole, function(streamSymbol, string) { | ||
| 286 | 287 | const ignoreErrors = this._ignoreErrors; | |
| 287 | 288 | const groupIndent = this[kGroupIndentationString]; | |
| 288 | 289 | ||
@@ -320,12 +321,12 @@ ObjectDefineProperties(Console.prototype, { | |||
| 320 | 321 | } finally { | |
| 321 | 322 | stream.removeListener('error', noop); | |
| 322 | 323 | } | |
| 323 | - }, | ||
| 324 | + }), | ||
| 324 | 325 | }, | |
| 325 | 326 | [kGetInspectOptions]: { | |
| 326 | 327 | __proto__: null, | |
| 327 | 328 | ...consolePropAttributes, | |
| 328 | - value: function(stream) { | ||
| 329 | + value: assignFunctionName(kGetInspectOptions, function(stream) { | ||
| 329 | 330 | let color = this[kColorMode]; | |
| 330 | 331 | if (color === 'auto') { | |
| 331 | 332 | color = lazyUtilColors().shouldColorize(stream); | |
@@ -341,12 +342,12 @@ ObjectDefineProperties(Console.prototype, { | |||
| 341 | 342 | } | |
| 342 | 343 | ||
| 343 | 344 | return color ? kColorInspectOptions : kNoColorInspectOptions; | |
| 344 | - }, | ||
| 345 | + }), | ||
| 345 | 346 | }, | |
| 346 | 347 | [kFormatForStdout]: { | |
| 347 | 348 | __proto__: null, | |
| 348 | 349 | ...consolePropAttributes, | |
| 349 | - value: function(args) { | ||
| 350 | + value: assignFunctionName(kFormatForStdout, function(args) { | ||
| 350 | 351 | if (args.length === 1) { | |
| 351 | 352 | // Fast path: single string, don't call format. | |
| 352 | 353 | // Avoids ReflectApply and validation overhead. | |
@@ -358,12 +359,12 @@ ObjectDefineProperties(Console.prototype, { | |||
| 358 | 359 | const opts = this[kGetInspectOptions](this._stdout); | |
| 359 | 360 | ArrayPrototypeUnshift(args, opts); | |
| 360 | 361 | return ReflectApply(formatWithOptions, null, args); | |
| 361 | - }, | ||
| 362 | + }), | ||
| 362 | 363 | }, | |
| 363 | 364 | [kFormatForStderr]: { | |
| 364 | 365 | __proto__: null, | |
| 365 | 366 | ...consolePropAttributes, | |
| 366 | - value: function(args) { | ||
| 367 | + value: assignFunctionName(kFormatForStderr, function(args) { | ||
| 367 | 368 | if (args.length === 1) { | |
| 368 | 369 | // Fast path: single string, don't call format. | |
| 369 | 370 | // Avoids ReflectApply and validation overhead. | |
@@ -375,7 +376,7 @@ ObjectDefineProperties(Console.prototype, { | |||
| 375 | 376 | const opts = this[kGetInspectOptions](this._stderr); | |
| 376 | 377 | ArrayPrototypeUnshift(args, opts); | |
| 377 | 378 | return ReflectApply(formatWithOptions, null, args); | |
| 378 | - }, | ||
| 379 | + }), | ||
| 379 | 380 | }, | |
| 380 | 381 | }); | |
| 381 | 382 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -758,7 +758,7 @@ function nextHookFactory(current, meta, { validateArgs, validateOutput }) { | |||
| 758 | 758 | if (next) { | |
| 759 | 759 | nextNextHook = nextHookFactory(next, meta, { validateArgs, validateOutput }); | |
| 760 | 760 | } else { | |
| 761 | - // eslint-disable-next-line func-name-matching | ||
| 761 | + // eslint-disable-next-line node-core/func-name-matching | ||
| 762 | 762 | nextNextHook = function chainAdvancedTooFar() { | |
| 763 | 763 | throw new ERR_INTERNAL_ASSERTION( | |
| 764 | 764 | `ESM custom loader '${hookName}' advanced beyond the end of the chain.`, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -120,7 +120,7 @@ function loadCJSModuleWithSpecialRequire(module, source, url, filename, isMain, | |||
| 120 | 120 | } | |
| 121 | 121 | const cascadedLoader = require('internal/modules/esm/loader').getOrInitializeCascadedLoader(); | |
| 122 | 122 | const __dirname = dirname(filename); | |
| 123 | - // eslint-disable-next-line func-name-matching,func-style | ||
| 123 | + // eslint-disable-next-line node-core/func-name-matching,func-style | ||
| 124 | 124 | const requireFn = function require(specifier) { | |
| 125 | 125 | let importAttributes = kEmptyObject; | |
| 126 | 126 | if (!StringPrototypeStartsWith(specifier, 'node:') && !BuiltinModule.normalizeRequirableId(specifier)) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -38,7 +38,7 @@ function throwInvalidThisError(Base, type) { | |||
| 38 | 38 | }, | |
| 39 | 39 | toString: { | |
| 40 | 40 | __proto__: null, | |
| 41 | - value() { | ||
| 41 | + value: function toString() { | ||
| 42 | 42 | return `${this.name} [${key}]: ${this.message}`; | |
| 43 | 43 | }, | |
| 44 | 44 | enumerable: false, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -84,6 +84,8 @@ const { | |||
| 84 | 84 | kOnConstructed, | |
| 85 | 85 | } = require('internal/streams/utils'); | |
| 86 | 86 | ||
| 87 | + const { assignFunctionName } = require('internal/util'); | ||
| 88 | + | ||
| 87 | 89 | const { errorOrDestroy } = destroyImpl; | |
| 88 | 90 | ||
| 89 | 91 | ObjectSetPrototypeOf(Writable.prototype, Stream.prototype); | |
@@ -434,12 +436,12 @@ function Writable(options) { | |||
| 434 | 436 | ||
| 435 | 437 | ObjectDefineProperty(Writable, SymbolHasInstance, { | |
| 436 | 438 | __proto__: null, | |
| 437 | - value: function(object) { | ||
| 438 | - if (FunctionPrototypeSymbolHasInstance(this, object)) return true; | ||
| 439 | + value: assignFunctionName(SymbolHasInstance, function(instance) { | ||
| 440 | + if (FunctionPrototypeSymbolHasInstance(this, instance)) return true; | ||
| 439 | 441 | if (this !== Writable) return false; | |
| 440 | 442 | ||
| 441 | - return object && object._writableState instanceof WritableState; | ||
| 442 | - }, | ||
| 443 | + return instance && instance._writableState instanceof WritableState; | ||
| 444 | + }), | ||
| 443 | 445 | }); | |
| 444 | 446 | ||
| 445 | 447 | // Otherwise people can pipe Writable streams, which is just wrong. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -644,7 +644,7 @@ class MockTimers { | |||
| 644 | 644 | __proto__: null, | |
| 645 | 645 | configurable: true, | |
| 646 | 646 | writable: true, | |
| 647 | - value: function value(delay) { | ||
| 647 | + value: function timeout(delay) { | ||
| 648 | 648 | validateUint32(delay, 'delay', false); | |
| 649 | 649 | const controller = new AbortController(); | |
| 650 | 650 | // Don't keep an unused binding to the timer; mock tick controls it | |
| Back | FazBrowse Home | New Git URL |
0 commit comments