Skip to content

Commit 00a2fc7

Browse files
aduh95marco-ippolito
authored andcommitted
lib: move Symbol[Async]Dispose polyfills to internal/util
PR-URL: #54853 Backport-PR-URL: #55264 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent f25a5b6 commit 00a2fc7

27 files changed

Lines changed: 50 additions & 45 deletions

‎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
letdebug=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
consterrors=require('internal/errors');
@@ -60,7 +58,7 @@ const {
6058
validatePort,
6159
}=require('internal/validators');
6260
const{ Buffer }=require('buffer');
63-
const{ deprecate, guessHandleType, promisify }=require('internal/util');
61+
const{ deprecate, guessHandleType, promisify, SymbolAsyncDispose, SymbolDispose}=require('internal/util');
6462
const{ isArrayBufferView }=require('internal/util/types');
6563
constEventEmitter=require('events');
6664
const{ addAbortListener }=require('internal/events/abort_listener');

‎lib/events.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,10 @@ const {
4848
Symbol,
4949
SymbolFor,
5050
SymbolAsyncIterator,
51-
SymbolDispose,
5251
}=primordials;
5352
constkRejection=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
constSocketList=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
constspawn_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
FunctionPrototypeBind,
2120
uncurryThis,
@@ -96,6 +95,7 @@ const {
9695
lazyDOMException,
9796
promisify,
9897
getLazy,
98+
SymbolAsyncDispose,
9999
}=require('internal/util');
100100
const{ EventEmitterMixin }=require('internal/event_target');
101101
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)