| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1c38f80 commit 2979113
23 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,13 +27,13 @@ const { | |||
| 27 | 27 | ArrayPrototypePush, | |
| 28 | 28 | ArrayPrototypeSlice, | |
| 29 | 29 | Error, | |
| 30 | + FunctionPrototypeCall, | ||
| 30 | 31 | NumberIsNaN, | |
| 31 | 32 | ObjectAssign, | |
| 32 | 33 | ObjectDefineProperty, | |
| 33 | 34 | ObjectIs, | |
| 34 | 35 | ObjectKeys, | |
| 35 | 36 | ObjectPrototypeIsPrototypeOf, | |
| 36 | - ReflectApply, | ||
| 37 | 37 | RegExpPrototypeExec, | |
| 38 | 38 | String, | |
| 39 | 39 | StringPrototypeIndexOf, | |
@@ -550,7 +550,7 @@ function expectedException(actual, expected, message, fn) { | |||
| 550 | 550 | throwError = true; | |
| 551 | 551 | } else { | |
| 552 | 552 | // Check validation functions return value. | |
| 553 | - const res = ReflectApply(expected, {}, [actual]); | ||
| 553 | + const res = FunctionPrototypeCall(expected, {}, actual); | ||
| 554 | 554 | if (res !== true) { | |
| 555 | 555 | if (!message) { | |
| 556 | 556 | generatedMessage = true; | |
@@ -695,7 +695,7 @@ function hasMatchingError(actual, expected) { | |||
| 695 | 695 | if (ObjectPrototypeIsPrototypeOf(Error, expected)) { | |
| 696 | 696 | return false; | |
| 697 | 697 | } | |
| 698 | - return ReflectApply(expected, {}, [actual]) === true; | ||
| 698 | + return FunctionPrototypeCall(expected, {}, actual) === true; | ||
| 699 | 699 | } | |
| 700 | 700 | ||
| 701 | 701 | function expectsNoError(stackStartFn, actual, error, message) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,7 +29,6 @@ const { | |||
| 29 | 29 | FunctionPrototypeCall, | |
| 30 | 30 | ObjectDefineProperty, | |
| 31 | 31 | ObjectSetPrototypeOf, | |
| 32 | - ReflectApply, | ||
| 33 | 32 | SymbolAsyncDispose, | |
| 34 | 33 | SymbolDispose, | |
| 35 | 34 | } = primordials; | |
@@ -436,7 +435,7 @@ Socket.prototype.connect = function(port, address, callback) { | |||
| 436 | 435 | return; | |
| 437 | 436 | } | |
| 438 | 437 | ||
| 439 | - ReflectApply(_connect, this, [port, address, callback]); | ||
| 438 | + FunctionPrototypeCall(_connect, this, port, address, callback); | ||
| 440 | 439 | }; | |
| 441 | 440 | ||
| 442 | 441 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,6 +29,7 @@ const { | |||
| 29 | 29 | ArrayPrototypePush, | |
| 30 | 30 | BigIntPrototypeToString, | |
| 31 | 31 | Boolean, | |
| 32 | + FunctionPrototypeCall, | ||
| 32 | 33 | MathMax, | |
| 33 | 34 | Number, | |
| 34 | 35 | ObjectDefineProperties, | |
@@ -365,7 +366,7 @@ function readFile(path, options, callback) { | |||
| 365 | 366 | } | |
| 366 | 367 | if (context.isUserFd) { | |
| 367 | 368 | process.nextTick(function tick(context) { | |
| 368 | - ReflectApply(readFileAfterOpen, { context }, [null, path]); | ||
| 369 | + FunctionPrototypeCall(readFileAfterOpen, { context }, null, path); | ||
| 369 | 370 | }, context); | |
| 370 | 371 | return; | |
| 371 | 372 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -805,8 +805,7 @@ function setupChannel(target, channel, serializationMode) { | |||
| 805 | 805 | obj = handleConversion[message.type]; | |
| 806 | 806 | ||
| 807 | 807 | // convert TCP object to native handle object | |
| 808 | - handle = ReflectApply(handleConversion[message.type].send, | ||
| 809 | - target, [message, handle, options]); | ||
| 808 | + handle = FunctionPrototypeCall(handleConversion[message.type].send, target, message, handle, options); | ||
| 810 | 809 | ||
| 811 | 810 | // If handle was sent twice, or it is impossible to get native handle | |
| 812 | 811 | // out of it - just send a text without the handle. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,6 +3,7 @@ | |||
| 3 | 3 | const { | |
| 4 | 4 | ArrayPrototypeJoin, | |
| 5 | 5 | FunctionPrototype, | |
| 6 | + FunctionPrototypeCall, | ||
| 6 | 7 | ObjectAssign, | |
| 7 | 8 | ReflectApply, | |
| 8 | 9 | SafeMap, | |
@@ -58,7 +59,7 @@ cluster._setupWorker = function() { | |||
| 58 | 59 | if (message.act === 'newconn') | |
| 59 | 60 | onconnection(message, handle); | |
| 60 | 61 | else if (message.act === 'disconnect') | |
| 61 | - ReflectApply(_disconnect, worker, [true]); | ||
| 62 | + FunctionPrototypeCall(_disconnect, worker, true); | ||
| 62 | 63 | } | |
| 63 | 64 | }; | |
| 64 | 65 | ||
@@ -287,7 +288,7 @@ function _disconnect(primaryInitiated) { | |||
| 287 | 288 | Worker.prototype.disconnect = function() { | |
| 288 | 289 | if (this.state !== 'disconnecting' && this.state !== 'destroying') { | |
| 289 | 290 | this.state = 'disconnecting'; | |
| 290 | - ReflectApply(_disconnect, this, []); | ||
| 291 | + FunctionPrototypeCall(_disconnect, this); | ||
| 291 | 292 | } | |
| 292 | 293 | ||
| 293 | 294 | return this; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,7 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | ||
| 3 | 3 | const { | |
| 4 | + FunctionPrototypeCall, | ||
| 4 | 5 | ObjectSetPrototypeOf, | |
| 5 | 6 | ReflectApply, | |
| 6 | 7 | } = primordials; | |
@@ -16,7 +17,7 @@ function Worker(options) { | |||
| 16 | 17 | if (!(this instanceof Worker)) | |
| 17 | 18 | return new Worker(options); | |
| 18 | 19 | ||
| 19 | - ReflectApply(EventEmitter, this, []); | ||
| 20 | + FunctionPrototypeCall(EventEmitter, this); | ||
| 20 | 21 | ||
| 21 | 22 | if (options === null || typeof options !== 'object') | |
| 22 | 23 | options = kEmptyObject; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,9 +1,9 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | ||
| 3 | 3 | const { | |
| 4 | + FunctionPrototypeCall, | ||
| 4 | 5 | NumberIsInteger, | |
| 5 | 6 | ObjectSetPrototypeOf, | |
| 6 | - ReflectApply, | ||
| 7 | 7 | } = primordials; | |
| 8 | 8 | ||
| 9 | 9 | const { | |
@@ -117,15 +117,15 @@ function createCipherBase(cipher, credential, options, isEncrypt, iv) { | |||
| 117 | 117 | this[kHandle] = new CipherBase(isEncrypt, cipher, credential, iv, authTagLength); | |
| 118 | 118 | this._decoder = null; | |
| 119 | 119 | ||
| 120 | - ReflectApply(LazyTransform, this, [options]); | ||
| 120 | + FunctionPrototypeCall(LazyTransform, this, options); | ||
| 121 | 121 | } | |
| 122 | 122 | ||
| 123 | 123 | function createCipherWithIV(cipher, key, options, isEncrypt, iv) { | |
| 124 | 124 | validateString(cipher, 'cipher'); | |
| 125 | 125 | const encoding = getStringOption(options, 'encoding'); | |
| 126 | 126 | key = prepareSecretKey(key, encoding); | |
| 127 | 127 | iv = iv === null ? null : getArrayBufferOrView(iv, 'iv'); | |
| 128 | - ReflectApply(createCipherBase, this, [cipher, key, options, isEncrypt, iv]); | ||
| 128 | + FunctionPrototypeCall(createCipherBase, this, cipher, key, options, isEncrypt, iv); | ||
| 129 | 129 | } | |
| 130 | 130 | ||
| 131 | 131 | // The Cipher class is part of the legacy Node.js crypto API. It exposes | |
@@ -215,7 +215,7 @@ function Cipheriv(cipher, key, iv, options) { | |||
| 215 | 215 | if (!(this instanceof Cipheriv)) | |
| 216 | 216 | return new Cipheriv(cipher, key, iv, options); | |
| 217 | 217 | ||
| 218 | - ReflectApply(createCipherWithIV, this, [cipher, key, options, true, iv]); | ||
| 218 | + FunctionPrototypeCall(createCipherWithIV, this, cipher, key, options, true, iv); | ||
| 219 | 219 | } | |
| 220 | 220 | ||
| 221 | 221 | function addCipherPrototypeFunctions(constructor) { | |
@@ -244,7 +244,7 @@ function Decipheriv(cipher, key, iv, options) { | |||
| 244 | 244 | if (!(this instanceof Decipheriv)) | |
| 245 | 245 | return new Decipheriv(cipher, key, iv, options); | |
| 246 | 246 | ||
| 247 | - ReflectApply(createCipherWithIV, this, [cipher, key, options, false, iv]); | ||
| 247 | + FunctionPrototypeCall(createCipherWithIV, this, cipher, key, options, false, iv); | ||
| 248 | 248 | } | |
| 249 | 249 | ||
| 250 | 250 | ObjectSetPrototypeOf(Decipheriv.prototype, LazyTransform.prototype); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,8 +1,8 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | ||
| 3 | 3 | const { | |
| 4 | + FunctionPrototypeCall, | ||
| 4 | 5 | ObjectSetPrototypeOf, | |
| 5 | - ReflectApply, | ||
| 6 | 6 | StringPrototypeReplace, | |
| 7 | 7 | StringPrototypeToLowerCase, | |
| 8 | 8 | Symbol, | |
@@ -105,7 +105,7 @@ function Hash(algorithm, options) { | |||
| 105 | 105 | if (!isCopy && xofLen === undefined) { | |
| 106 | 106 | maybeEmitDeprecationWarning(algorithm); | |
| 107 | 107 | } | |
| 108 | - ReflectApply(LazyTransform, this, [options]); | ||
| 108 | + FunctionPrototypeCall(LazyTransform, this, options); | ||
| 109 | 109 | } | |
| 110 | 110 | ||
| 111 | 111 | ObjectSetPrototypeOf(Hash.prototype, LazyTransform.prototype); | |
@@ -169,7 +169,7 @@ function Hmac(hmac, key, options) { | |||
| 169 | 169 | this[kState] = { | |
| 170 | 170 | [kFinalized]: false, | |
| 171 | 171 | }; | |
| 172 | - ReflectApply(LazyTransform, this, [options]); | ||
| 172 | + FunctionPrototypeCall(LazyTransform, this, options); | ||
| 173 | 173 | } | |
| 174 | 174 | ||
| 175 | 175 | ObjectSetPrototypeOf(Hmac.prototype, LazyTransform.prototype); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,7 +3,6 @@ | |||
| 3 | 3 | const { | |
| 4 | 4 | FunctionPrototypeCall, | |
| 5 | 5 | ObjectSetPrototypeOf, | |
| 6 | - ReflectApply, | ||
| 7 | 6 | } = primordials; | |
| 8 | 7 | ||
| 9 | 8 | const { | |
@@ -59,7 +58,7 @@ function Sign(algorithm, options) { | |||
| 59 | 58 | this[kHandle] = new _Sign(); | |
| 60 | 59 | this[kHandle].init(algorithm); | |
| 61 | 60 | ||
| 62 | - ReflectApply(Writable, this, [options]); | ||
| 61 | + FunctionPrototypeCall(Writable, this, options); | ||
| 63 | 62 | } | |
| 64 | 63 | ||
| 65 | 64 | ObjectSetPrototypeOf(Sign.prototype, Writable.prototype); | |
@@ -219,7 +218,7 @@ function Verify(algorithm, options) { | |||
| 219 | 218 | this[kHandle] = new _Verify(); | |
| 220 | 219 | this[kHandle].init(algorithm); | |
| 221 | 220 | ||
| 222 | - ReflectApply(Writable, this, [options]); | ||
| 221 | + FunctionPrototypeCall(Writable, this, options); | ||
| 223 | 222 | } | |
| 224 | 223 | ||
| 225 | 224 | ObjectSetPrototypeOf(Verify.prototype, Writable.prototype); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,6 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | 3 | const { | |
| 4 | 4 | ArrayPrototypeIncludes, | |
| 5 | + FunctionPrototypeCall, | ||
| 5 | 6 | JSONParse, | |
| 6 | 7 | JSONStringify, | |
| 7 | 8 | ObjectDefineProperties, | |
@@ -84,7 +85,7 @@ async function digest(algorithm, data) { | |||
| 84 | 85 | ||
| 85 | 86 | algorithm = normalizeAlgorithm(algorithm, 'digest'); | |
| 86 | 87 | ||
| 87 | - return await ReflectApply(asyncDigest, this, [algorithm, data]); | ||
| 88 | + return await FunctionPrototypeCall(asyncDigest, this, algorithm, data); | ||
| 88 | 89 | } | |
| 89 | 90 | ||
| 90 | 91 | function randomUUID() { | |
@@ -377,10 +378,10 @@ async function deriveKey( | |||
| 377 | 378 | throw lazyDOMException('Unrecognized algorithm name', 'NotSupportedError'); | |
| 378 | 379 | } | |
| 379 | 380 | ||
| 380 | - return ReflectApply( | ||
| 381 | + return FunctionPrototypeCall( | ||
| 381 | 382 | importKeySync, | |
| 382 | 383 | this, | |
| 383 | - ['raw-secret', bits, derivedKeyAlgorithm, extractable, keyUsages], | ||
| 384 | + 'raw-secret', bits, derivedKeyAlgorithm, extractable, keyUsages, | ||
| 384 | 385 | ); | |
| 385 | 386 | } | |
| 386 | 387 | ||
@@ -889,10 +890,10 @@ async function importKey( | |||
| 889 | 890 | ||
| 890 | 891 | algorithm = normalizeAlgorithm(algorithm, 'importKey'); | |
| 891 | 892 | ||
| 892 | - return ReflectApply( | ||
| 893 | + return FunctionPrototypeCall( | ||
| 893 | 894 | importKeySync, | |
| 894 | 895 | this, | |
| 895 | - [format, keyData, algorithm, extractable, keyUsages], | ||
| 896 | + format, keyData, algorithm, extractable, keyUsages, | ||
| 896 | 897 | ); | |
| 897 | 898 | } | |
| 898 | 899 | ||
@@ -926,7 +927,7 @@ async function wrapKey(format, key, wrappingKey, algorithm) { | |||
| 926 | 927 | } catch { | |
| 927 | 928 | algorithm = normalizeAlgorithm(algorithm, 'encrypt'); | |
| 928 | 929 | } | |
| 929 | - let keyData = await ReflectApply(exportKey, this, [format, key]); | ||
| 930 | + let keyData = await FunctionPrototypeCall(exportKey, this, format, key); | ||
| 930 | 931 | ||
| 931 | 932 | if (format === 'jwk') { | |
| 932 | 933 | const ec = new TextEncoder(); | |
@@ -1023,10 +1024,10 @@ async function unwrapKey( | |||
| 1023 | 1024 | } | |
| 1024 | 1025 | } | |
| 1025 | 1026 | ||
| 1026 | - return ReflectApply( | ||
| 1027 | + return FunctionPrototypeCall( | ||
| 1027 | 1028 | importKeySync, | |
| 1028 | 1029 | this, | |
| 1029 | - [format, keyData, unwrappedKeyAlgo, extractable, keyUsages], | ||
| 1030 | + format, keyData, unwrappedKeyAlgo, extractable, keyUsages, | ||
| 1030 | 1031 | ); | |
| 1031 | 1032 | } | |
| 1032 | 1033 | ||
@@ -1349,10 +1350,10 @@ async function encapsulateKey(encapsulationAlgorithm, encapsulationKey, sharedKe | |||
| 1349 | 1350 | throw lazyDOMException('Unrecognized algorithm name', 'NotSupportedError'); | |
| 1350 | 1351 | } | |
| 1351 | 1352 | ||
| 1352 | - const sharedKey = ReflectApply( | ||
| 1353 | + const sharedKey = FunctionPrototypeCall( | ||
| 1353 | 1354 | importKeySync, | |
| 1354 | 1355 | this, | |
| 1355 | - ['raw-secret', encapsulateBits.sharedKey, normalizedSharedKeyAlgorithm, extractable, usages], | ||
| 1356 | + 'raw-secret', encapsulateBits.sharedKey, normalizedSharedKeyAlgorithm, extractable, usages, | ||
| 1356 | 1357 | ); | |
| 1357 | 1358 | ||
| 1358 | 1359 | const encapsulatedKey = { | |
@@ -1469,10 +1470,10 @@ async function decapsulateKey( | |||
| 1469 | 1470 | throw lazyDOMException('Unrecognized algorithm name', 'NotSupportedError'); | |
| 1470 | 1471 | } | |
| 1471 | 1472 | ||
| 1472 | - return ReflectApply( | ||
| 1473 | + return FunctionPrototypeCall( | ||
| 1473 | 1474 | importKeySync, | |
| 1474 | 1475 | this, | |
| 1475 | - ['raw-secret', decapsulatedBits, normalizedSharedKeyAlgorithm, extractable, usages], | ||
| 1476 | + 'raw-secret', decapsulatedBits, normalizedSharedKeyAlgorithm, extractable, usages, | ||
| 1476 | 1477 | ); | |
| 1477 | 1478 | } | |
| 1478 | 1479 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments