| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,6 +44,7 @@ const { | |||
| 44 | 44 | const { | |
| 45 | 45 | createDeferredPromise, | |
| 46 | 46 | customInspectSymbol: kInspect, | |
| 47 | + kEmptyObject, | ||
| 47 | 48 | } = require('internal/util'); | |
| 48 | 49 | const { inspect } = require('internal/util/inspect'); | |
| 49 | 50 | ||
@@ -134,7 +135,7 @@ class Blob { | |||
| 134 | 135 | * }} [options] | |
| 135 | 136 | * @constructs {Blob} | |
| 136 | 137 | */ | |
| 137 | - constructor(sources = [], options = {}) { | ||
| 138 | + constructor(sources = [], options = kEmptyObject) { | ||
| 138 | 139 | if (sources === null || | |
| 139 | 140 | typeof sources[SymbolIterator] !== 'function' || | |
| 140 | 141 | typeof sources === 'string') { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,6 +33,7 @@ const kEncoder = Symbol('encoder'); | |||
| 33 | 33 | const { | |
| 34 | 34 | getConstructorOf, | |
| 35 | 35 | customInspectSymbol: inspect, | |
| 36 | + kEmptyObject, | ||
| 36 | 37 | kEnumerableProperty, | |
| 37 | 38 | } = require('internal/util'); | |
| 38 | 39 | ||
@@ -379,7 +380,7 @@ function makeTextDecoderICU() { | |||
| 379 | 380 | } = internalBinding('icu'); | |
| 380 | 381 | ||
| 381 | 382 | class TextDecoder { | |
| 382 | - constructor(encoding = 'utf-8', options = {}) { | ||
| 383 | + constructor(encoding = 'utf-8', options = kEmptyObject) { | ||
| 383 | 384 | encoding = `${encoding}`; | |
| 384 | 385 | validateObject(options, 'options', { | |
| 385 | 386 | nullable: true, | |
@@ -408,7 +409,7 @@ function makeTextDecoderICU() { | |||
| 408 | 409 | } | |
| 409 | 410 | ||
| 410 | 411 | ||
| 411 | - decode(input = empty, options = {}) { | ||
| 412 | + decode(input = empty, options = kEmptyObject) { | ||
| 412 | 413 | validateDecoder(this); | |
| 413 | 414 | if (isAnyArrayBuffer(input)) { | |
| 414 | 415 | input = lazyBuffer().from(input); | |
@@ -453,7 +454,7 @@ function makeTextDecoderJS() { | |||
| 453 | 454 | } | |
| 454 | 455 | ||
| 455 | 456 | class TextDecoder { | |
| 456 | - constructor(encoding = 'utf-8', options = {}) { | ||
| 457 | + constructor(encoding = 'utf-8', options = kEmptyObject) { | ||
| 457 | 458 | encoding = `${encoding}`; | |
| 458 | 459 | validateObject(options, 'options', { | |
| 459 | 460 | nullable: true, | |
@@ -481,7 +482,7 @@ function makeTextDecoderJS() { | |||
| 481 | 482 | this[kBOMSeen] = false; | |
| 482 | 483 | } | |
| 483 | 484 | ||
| 484 | - decode(input = empty, options = {}) { | ||
| 485 | + decode(input = empty, options = kEmptyObject) { | ||
| 485 | 486 | validateDecoder(this); | |
| 486 | 487 | if (isAnyArrayBuffer(input)) { | |
| 487 | 488 | input = lazyBuffer().from(input); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,6 +17,7 @@ const { | |||
| 17 | 17 | ||
| 18 | 18 | const { | |
| 19 | 19 | customInspectSymbol: kInspect, | |
| 20 | + kEmptyObject, | ||
| 20 | 21 | } = require('internal/util'); | |
| 21 | 22 | ||
| 22 | 23 | const { inspect } = require('util'); | |
@@ -352,7 +353,7 @@ internalRecordableHistogram.prototype[kDeserialize] = () => {}; | |||
| 352 | 353 | * }} [options] | |
| 353 | 354 | * @returns {RecordableHistogram} | |
| 354 | 355 | */ | |
| 355 | - function createHistogram(options = {}) { | ||
| 356 | + function createHistogram(options = kEmptyObject) { | ||
| 356 | 357 | validateObject(options, 'options'); | |
| 357 | 358 | const { | |
| 358 | 359 | lowest = 1, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,6 +11,7 @@ const { | |||
| 11 | 11 | const { setPromiseHooks } = internalBinding('async_wrap'); | |
| 12 | 12 | const { triggerUncaughtException } = internalBinding('errors'); | |
| 13 | 13 | ||
| 14 | + const { kEmptyObject } = require('internal/util'); | ||
| 14 | 15 | const { validatePlainFunction } = require('internal/validators'); | |
| 15 | 16 | ||
| 16 | 17 | const hooks = { | |
@@ -101,7 +102,7 @@ const onBefore = makeUseHook('before'); | |||
| 101 | 102 | const onAfter = makeUseHook('after'); | |
| 102 | 103 | const onSettled = makeUseHook('settled'); | |
| 103 | 104 | ||
| 104 | - function createHook({ init, before, after, settled } = {}) { | ||
| 105 | + function createHook({ init, before, after, settled } = kEmptyObject) { | ||
| 105 | 106 | const hooks = []; | |
| 106 | 107 | ||
| 107 | 108 | if (init) ArrayPrototypePush(hooks, onInit(init)); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments