| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1b4984d commit fa40366
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,21 +3,14 @@ | |||
| 3 | 3 | const { | |
| 4 | 4 | Array, | |
| 5 | 5 | ArrayIsArray, | |
| 6 | - BigInt64Array, | ||
| 7 | 6 | BigIntPrototypeValueOf, | |
| 8 | - BigUint64Array, | ||
| 9 | 7 | BooleanPrototypeValueOf, | |
| 10 | 8 | DatePrototypeGetTime, | |
| 11 | 9 | DatePrototypeToISOString, | |
| 12 | 10 | DatePrototypeToString, | |
| 13 | 11 | ErrorPrototypeToString, | |
| 14 | - Float32Array, | ||
| 15 | - Float64Array, | ||
| 16 | 12 | FunctionPrototypeCall, | |
| 17 | 13 | FunctionPrototypeToString, | |
| 18 | - Int8Array, | ||
| 19 | - Int16Array, | ||
| 20 | - Int32Array, | ||
| 21 | 14 | JSONStringify, | |
| 22 | 15 | Map, | |
| 23 | 16 | MapPrototypeGetSize, | |
@@ -59,10 +52,8 @@ const { | |||
| 59 | 52 | SymbolIterator, | |
| 60 | 53 | SymbolToStringTag, | |
| 61 | 54 | TypedArrayPrototypeGetLength, | |
| 62 | - Uint16Array, | ||
| 63 | - Uint32Array, | ||
| 55 | + TypedArrayPrototypeGetSymbolToStringTag, | ||
| 64 | 56 | Uint8Array, | |
| 65 | - Uint8ClampedArray, | ||
| 66 | 57 | uncurryThis, | |
| 67 | 58 | } = primordials; | |
| 68 | 59 | ||
@@ -120,17 +111,6 @@ const { | |||
| 120 | 111 | isNumberObject, | |
| 121 | 112 | isBooleanObject, | |
| 122 | 113 | isBigIntObject, | |
| 123 | - isUint8Array, | ||
| 124 | - isUint8ClampedArray, | ||
| 125 | - isUint16Array, | ||
| 126 | - isUint32Array, | ||
| 127 | - isInt8Array, | ||
| 128 | - isInt16Array, | ||
| 129 | - isInt32Array, | ||
| 130 | - isFloat32Array, | ||
| 131 | - isFloat64Array, | ||
| 132 | - isBigInt64Array, | ||
| 133 | - isBigUint64Array | ||
| 134 | 114 | } = require('internal/util/types'); | |
| 135 | 115 | ||
| 136 | 116 | const assert = require('internal/assert'); | |
@@ -712,26 +692,6 @@ function formatProxy(ctx, proxy, recurseTimes) { | |||
| 712 | 692 | ctx, res, '', ['Proxy [', ']'], kArrayExtrasType, recurseTimes); | |
| 713 | 693 | } | |
| 714 | 694 | ||
| 715 | - function findTypedConstructor(value) { | ||
| 716 | - for (const [check, clazz] of [ | ||
| 717 | - [isUint8Array, Uint8Array], | ||
| 718 | - [isUint8ClampedArray, Uint8ClampedArray], | ||
| 719 | - [isUint16Array, Uint16Array], | ||
| 720 | - [isUint32Array, Uint32Array], | ||
| 721 | - [isInt8Array, Int8Array], | ||
| 722 | - [isInt16Array, Int16Array], | ||
| 723 | - [isInt32Array, Int32Array], | ||
| 724 | - [isFloat32Array, Float32Array], | ||
| 725 | - [isFloat64Array, Float64Array], | ||
| 726 | - [isBigInt64Array, BigInt64Array], | ||
| 727 | - [isBigUint64Array, BigUint64Array] | ||
| 728 | - ]) { | ||
| 729 | - if (check(value)) { | ||
| 730 | - return clazz; | ||
| 731 | - } | ||
| 732 | - } | ||
| 733 | - } | ||
| 734 | - | ||
| 735 | 695 | // Note: using `formatValue` directly requires the indentation level to be | |
| 736 | 696 | // corrected by setting `ctx.indentationLvL += diff` and then to decrease the | |
| 737 | 697 | // value afterwards again. | |
@@ -879,10 +839,9 @@ function formatRaw(ctx, value, recurseTimes, typedArray) { | |||
| 879 | 839 | let bound = value; | |
| 880 | 840 | let fallback = ''; | |
| 881 | 841 | if (constructor === null) { | |
| 882 | - const constr = findTypedConstructor(value); | ||
| 883 | - fallback = constr.name; | ||
| 842 | + fallback = TypedArrayPrototypeGetSymbolToStringTag(value); | ||
| 884 | 843 | // Reconstruct the array information. | |
| 885 | - bound = new constr(value); | ||
| 844 | + bound = new primordials[fallback](value); | ||
| 886 | 845 | } | |
| 887 | 846 | const size = TypedArrayPrototypeGetLength(value); | |
| 888 | 847 | const prefix = getPrefix(constructor, tag, fallback, `(${size})`); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments