Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ad7281b

Browse filesBrowse files
targosMylesBorins
authored andcommitted
lib: use remaining typed arrays from primordials
PR-URL: #35499 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org> Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
1 parent 7f8834f commit ad7281b
Copy full SHA for ad7281b

File tree

Expand file treeCollapse file tree

13 files changed

+29
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

13 files changed

+29
-3
lines changed
Open diff view settings
Collapse file

‎lib/.eslintrc.yaml‎

Copy file name to clipboardExpand all lines: lib/.eslintrc.yaml
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ rules:
1111
- error
1212
- name: Array
1313
message: "Use `const { Array } = primordials;` instead of the global."
14+
- name: ArrayBuffer
15+
message: "Use `const { ArrayBuffer } = primordials;` instead of the global."
1416
- name: BigInt
1517
message: "Use `const { BigInt } = primordials;` instead of the global."
1618
- name: BigInt64Array
@@ -47,6 +49,12 @@ rules:
4749
message: "Use `const { Symbol } = primordials;` instead of the global."
4850
- name: Uint16Array
4951
message: "Use `const { Uint16Array } = primordials;` instead of the global."
52+
- name: Uint32Array
53+
message: "Use `const { Uint32Array } = primordials;` instead of the global."
54+
- name: Uint8Array
55+
message: "Use `const { Uint8Array } = primordials;` instead of the global."
56+
- name: Uint8ClampedArray
57+
message: "Use `const { Uint8ClampedArray } = primordials;` instead of the global."
5058
- name: WeakMap
5159
message: "Use `const { WeakMap } = primordials;` instead of the global."
5260
- name: WeakSet
Collapse file

‎lib/buffer.js‎

Copy file name to clipboardExpand all lines: lib/buffer.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const {
3939
ObjectSetPrototypeOf,
4040
SymbolSpecies,
4141
SymbolToPrimitive,
42+
Uint8Array,
4243
Uint8ArrayPrototype,
4344
} = primordials;
4445

@@ -400,7 +401,7 @@ function SlowBuffer(length) {
400401
return createUnsafeBuffer(length);
401402
}
402403

403-
ObjectSetPrototypeOf(SlowBuffer.prototype, Uint8Array.prototype);
404+
ObjectSetPrototypeOf(SlowBuffer.prototype, Uint8ArrayPrototype);
404405
ObjectSetPrototypeOf(SlowBuffer, Uint8Array);
405406

406407
function allocate(size) {
Collapse file

‎lib/internal/buffer.js‎

Copy file name to clipboardExpand all lines: lib/internal/buffer.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const {
55
Float32Array,
66
MathFloor,
77
Number,
8+
Uint8Array,
89
} = primordials;
910

1011
const {
Collapse file

‎lib/internal/child_process.js‎

Copy file name to clipboardExpand all lines: lib/internal/child_process.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const {
55
ObjectDefineProperty,
66
ObjectSetPrototypeOf,
77
Symbol,
8+
Uint8Array,
89
} = primordials;
910

1011
const {
Collapse file

‎lib/internal/encoding.js‎

Copy file name to clipboardExpand all lines: lib/internal/encoding.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ const {
1010
ObjectGetOwnPropertyDescriptors,
1111
Symbol,
1212
SymbolToStringTag,
13+
Uint32Array,
14+
Uint8Array,
1315
} = primordials;
1416

1517
const {
Collapse file

‎lib/internal/http2/core.js‎

Copy file name to clipboardExpand all lines: lib/internal/http2/core.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ const {
1515
ReflectGetPrototypeOf,
1616
Set,
1717
Symbol,
18+
Uint32Array,
19+
Uint8Array,
1820
} = primordials;
1921

2022
const {
Collapse file

‎lib/internal/process/per_thread.js‎

Copy file name to clipboardExpand all lines: lib/internal/process/per_thread.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const {
1717
SetPrototype,
1818
SetPrototypeHas,
1919
StringPrototypeReplace,
20+
Uint32Array,
2021
} = primordials;
2122

2223
const {
Collapse file

‎lib/internal/streams/buffer_list.js‎

Copy file name to clipboardExpand all lines: lib/internal/streams/buffer_list.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const {
44
SymbolIterator,
5+
Uint8Array,
56
} = primordials;
67

78
const { Buffer } = require('buffer');
Collapse file

‎lib/internal/util/comparisons.js‎

Copy file name to clipboardExpand all lines: lib/internal/util/comparisons.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const {
2020
StringPrototypeValueOf,
2121
SymbolPrototypeValueOf,
2222
SymbolToStringTag,
23+
Uint8Array,
2324
} = primordials;
2425

2526
const { compare } = internalBinding('buffer');
Collapse file

‎lib/internal/util/inspect.js‎

Copy file name to clipboardExpand all lines: lib/internal/util/inspect.js
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ const {
5252
SymbolIterator,
5353
SymbolToStringTag,
5454
Uint16Array,
55+
Uint32Array,
56+
Uint8Array,
57+
Uint8ArrayPrototype,
58+
Uint8ClampedArray,
5559
uncurryThis,
5660
} = primordials;
5761

@@ -132,7 +136,7 @@ const mapSizeGetter = uncurryThis(
132136
ObjectGetOwnPropertyDescriptor(MapPrototype, 'size').get);
133137
const typedArraySizeGetter = uncurryThis(
134138
ObjectGetOwnPropertyDescriptor(
135-
ObjectGetPrototypeOf(Uint8Array.prototype), 'length').get);
139+
ObjectGetPrototypeOf(Uint8ArrayPrototype), 'length').get);
136140

137141
let hexSlice;
138142

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.