Skip to content

Commit da1bd47

Browse files
committed
fix promises export for readline & inspector
1 parent 0b84f58 commit da1bd47

4 files changed

Lines changed: 36 additions & 2 deletions

File tree

src/node/BUILD.bazel

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ wd_ts_bundle(
1414
"assert/*.ts",
1515
"dns/*.ts",
1616
"fs/*.ts",
17-
"stream/*.js",
17+
"inspector/*.ts",
1818
"path/*.ts",
19-
"util/*.ts",
19+
"readline/*.ts",
20+
"stream/*.js",
2021
"timers/*.ts",
22+
"util/*.ts",
2123
]),
2224
schema_id = "0xbcc8f57c63814005",
2325
tsconfig_json = "tsconfig.json",

src/node/inspector/promises.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,22 @@ export const Network: typeof _Network = {
5252
loadingFailed(_params: _Network.LoadingFailedEventDataType): void {
5353
throw new ERR_METHOD_NOT_IMPLEMENTED('Network.loadingFailed');
5454
},
55+
webSocketHandshakeResponseReceived(
56+
_params: _Network.WebSocketHandshakeResponseReceivedEventDataType
57+
): void {
58+
throw new ERR_METHOD_NOT_IMPLEMENTED(
59+
'Network.webSocketHandshakeResponseReceived'
60+
);
61+
},
62+
webSocketClosed(_params: _Network.WebSocketClosedEventDataType): void {
63+
throw new ERR_METHOD_NOT_IMPLEMENTED('Network.webSocketClosed');
64+
},
65+
webSocketCreated(_params: _Network.WebSocketCreatedEventDataType): void {
66+
throw new ERR_METHOD_NOT_IMPLEMENTED('Network.webSocketCreated');
67+
},
68+
dataSent(_params: unknown): void {
69+
throw new ERR_METHOD_NOT_IMPLEMENTED('Network.dataSent');
70+
},
5571
};
5672

5773
export class Session extends EventEmitter implements _Session {

src/workerd/api/node/tests/inspector-nodejs-test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import inspector from 'node:inspector';
22
import assert from 'node:assert';
33
import { EventEmitter } from 'node:events';
4+
import promises from 'node:inspector/promises';
45

56
export const inspectorClose = {
67
test() {
@@ -289,3 +290,10 @@ export const inspectorSessionInheritance = {
289290
}
290291
},
291292
};
293+
294+
export const inspectorPromises = {
295+
test() {
296+
assert.strictEqual(typeof promises, 'object');
297+
assert.strictEqual(typeof promises.Session, 'function');
298+
},
299+
};

src/workerd/api/node/tests/readline-nodejs-test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import readline from 'node:readline';
22
import assert from 'node:assert';
33
import { EventEmitter } from 'node:events';
4+
import promises from 'node:readline/promises';
45

56
export const readlineClearLine = {
67
test() {
@@ -207,3 +208,10 @@ export const readlineFunctionReturnValues = {
207208
}
208209
},
209210
};
211+
212+
export const readlineImportedPromisesModule = {
213+
test() {
214+
assert.strictEqual(typeof promises, 'object');
215+
assert.strictEqual(typeof promises.createInterface, 'function');
216+
},
217+
};

0 commit comments

Comments
 (0)