Skip to content

Commit 5f02e1b

Browse files
committed
lib: move Symbol[Async]Dispose polyfills to internal/util
PR-URL: #54853 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent b96ee30 commit 5f02e1b

27 files changed

+48
-41
lines changed

lib/_http_server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ const {
2929
ObjectSetPrototypeOf,
3030
ReflectApply,
3131
Symbol,
32-
SymbolAsyncDispose,
3332
SymbolFor,
3433
} = primordials;
3534

@@ -82,6 +81,7 @@ const {
8281
const {
8382
kEmptyObject,
8483
promisify,
84+
SymbolAsyncDispose,
8585
} = require('internal/util');
8686
const {
8787
validateInteger,

lib/child_process.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ const {
4242
StringPrototypeIncludes,
4343
StringPrototypeSlice,
4444
StringPrototypeToUpperCase,
45-
SymbolDispose,
4645
} = primordials;
4746

4847
const {
@@ -51,6 +50,7 @@ const {
5150
getSystemErrorName,
5251
kEmptyObject,
5352
promisify,
53+
SymbolDispose,
5454
} = require('internal/util');
5555
const { isArrayBufferView } = require('internal/util/types');
5656
let debug = require('internal/util/debuglog').debuglog(

lib/dgram.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ const {
3030
ObjectDefineProperty,
3131
ObjectSetPrototypeOf,
3232
ReflectApply,
33-
SymbolAsyncDispose,
34-
SymbolDispose,
3533
} = primordials;
3634

3735
const {
@@ -63,7 +61,7 @@ const {
6361
validatePort,
6462
} = require('internal/validators');
6563
const { Buffer } = require('buffer');
66-
const { deprecate, guessHandleType, promisify } = require('internal/util');
64+
const { deprecate, guessHandleType, promisify, SymbolAsyncDispose, SymbolDispose } = require('internal/util');
6765
const { isArrayBufferView } = require('internal/util/types');
6866
const EventEmitter = require('events');
6967
const { addAbortListener } = require('internal/events/abort_listener');

lib/events.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,11 @@ const {
4747
StringPrototypeSplit,
4848
Symbol,
4949
SymbolAsyncIterator,
50-
SymbolDispose,
5150
SymbolFor,
5251
} = primordials;
5352
const kRejection = SymbolFor('nodejs.rejection');
5453

55-
const { kEmptyObject } = require('internal/util');
54+
const { SymbolDispose, kEmptyObject } = require('internal/util');
5655

5756
const {
5857
inspect,

lib/https.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ const {
3333
ObjectSetPrototypeOf,
3434
ReflectApply,
3535
ReflectConstruct,
36-
SymbolAsyncDispose,
3736
} = primordials;
3837

3938
const {
4039
assertCrypto,
4140
kEmptyObject,
4241
promisify,
42+
SymbolAsyncDispose,
4343
} = require('internal/util');
4444
assertCrypto();
4545

lib/inspector.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ const {
44
JSONParse,
55
JSONStringify,
66
SafeMap,
7-
SymbolDispose,
87
} = primordials;
98

9+
const {
10+
SymbolDispose,
11+
} = require('internal/util');
12+
1013
const {
1114
ERR_INSPECTOR_ALREADY_ACTIVATED,
1215
ERR_INSPECTOR_ALREADY_CONNECTED,

lib/internal/child_process.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const {
1212
ReflectApply,
1313
StringPrototypeSlice,
1414
Symbol,
15-
SymbolDispose,
1615
Uint8Array,
1716
} = primordials;
1817

@@ -56,7 +55,7 @@ const { TTY } = internalBinding('tty_wrap');
5655
const { UDP } = internalBinding('udp_wrap');
5756
const SocketList = require('internal/socket_list');
5857
const { owner_symbol } = require('internal/async_hooks').symbols;
59-
const { convertToValidSignal, deprecate } = require('internal/util');
58+
const { convertToValidSignal, deprecate, SymbolDispose } = require('internal/util');
6059
const { isArrayBufferView } = require('internal/util/types');
6160
const spawn_sync = internalBinding('spawn_sync');
6261
const { kStateSymbol } = require('internal/dgram');

lib/internal/events/abort_listener.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const {
44
SymbolDispose,
5-
} = primordials;
5+
} = require('internal/util');
66
const {
77
validateAbortSignal,
88
validateFunction,

lib/internal/fs/promises.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ const {
1515
SafeArrayIterator,
1616
SafePromisePrototypeFinally,
1717
Symbol,
18-
SymbolAsyncDispose,
1918
Uint8Array,
2019
uncurryThis,
2120
} = primordials;
@@ -99,6 +98,7 @@ const {
9998
promisify,
10099
isWindows,
101100
isMacOS,
101+
SymbolAsyncDispose,
102102
} = require('internal/util');
103103
const EventEmitter = require('events');
104104
const { StringDecoder } = require('string_decoder');

lib/internal/http2/core.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ const {
1919
SafeMap,
2020
SafeSet,
2121
Symbol,
22-
SymbolAsyncDispose,
23-
SymbolDispose,
2422
Uint32Array,
2523
Uint8Array,
2624
} = primordials;
@@ -30,6 +28,8 @@ const {
3028
customInspectSymbol: kInspect,
3129
kEmptyObject,
3230
promisify,
31+
SymbolAsyncDispose,
32+
SymbolDispose,
3333
} = require('internal/util');
3434

3535
assertCrypto();

0 commit comments

Comments
 (0)