Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/internal/debugger/inspect_probe.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,13 +505,15 @@ class ProbeInspectorSession {

onChildOutput(text, which) {
if (which !== 'stderr') { return; }
debug('child stderr: %j', text);

this.childStderr += text;

const combined = this.disconnectSentinelBuffer + text;
// Detect the disconnect sentinel.
if (this.connected &&
StringPrototypeIncludes(combined, kProbeDisconnectSentinel)) {
debug('disconnect sentinel detected, resetting client');
this.disconnectRequested = true;
this.client.reset();
}
Expand Down Expand Up @@ -587,6 +589,7 @@ class ProbeInspectorSession {
}

onPaused(params) {
debug('paused: finished=%d, reason=%s hitBreakpoints=%j', this.finished, params.reason, params.hitBreakpoints);
this.handlePaused(params).catch((error) => {
if (error === kInspectorFailedSentinel) { return; }
this.recordInspectorFailure({
Expand Down Expand Up @@ -837,6 +840,9 @@ class ProbeInspectorSession {
}

onScriptParsed(params) {
if (params.url && !StringPrototypeStartsWith(params.url, 'node:')) {
debug('scriptParsed: scriptId=%s url=%s, length=%d', params.scriptId, params.url, params.length);
}
// This map grows by the number of scripts parsed, which is limited, and is just a
// small string -> string map. The lifetime is bounded by probe timeout etc. so cleanup is overkill.
this.scriptIdToUrl.set(params.scriptId, params.url);
Expand Down Expand Up @@ -879,6 +885,8 @@ class ProbeInspectorSession {
}

const result = await this.callCdp('Debugger.setBreakpointByUrl', params);
debug('breakpoint set: id=%s urlRegex=%s locations=%j',
result.breakpointId, params.urlRegex, result.locations);
this.breakpointDefinitions.set(result.breakpointId, { probeIndices });
}
}
Expand Down
10 changes: 9 additions & 1 deletion lib/internal/streams/iter/pull.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const {
ArrayPrototypePush,
ArrayPrototypeSlice,
PromisePrototypeThen,
PromiseResolve,
SymbolAsyncIterator,
SymbolIterator,
TypedArrayPrototypeGetByteLength,
Expand Down Expand Up @@ -922,7 +923,14 @@ async function pipeTo(source, ...args) {
return waitForSyncBackpressure();
}
const opts = signal ? { __proto__: null, signal } : undefined;
return PromisePrototypeThen(writer.writev(batch, opts), () => {
const result = writer.writev(batch, opts);
if (result === undefined) {
for (let i = 0; i < batch.length; i++) {
totalBytes += TypedArrayPrototypeGetByteLength(batch[i]);
}
return;
}
return PromisePrototypeThen(PromiseResolve(result), () => {
for (let i = 0; i < batch.length; i++) {
totalBytes += TypedArrayPrototypeGetByteLength(batch[i]);
}
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/wpt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Last update:
- wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/288c467d35/wasm/jsapi
- wasm/webapi: https://github.com/web-platform-tests/wpt/tree/fd1b23eeaa/wasm/webapi
- web-locks: https://github.com/web-platform-tests/wpt/tree/10a122a6bc/web-locks
- WebCryptoAPI: https://github.com/web-platform-tests/wpt/tree/97bbc7247a/WebCryptoAPI
- WebCryptoAPI: https://github.com/web-platform-tests/wpt/tree/0c413fb56b/WebCryptoAPI
- webidl: https://github.com/web-platform-tests/wpt/tree/63ca529a02/webidl
- webidl/ecmascript-binding/es-exceptions: https://github.com/web-platform-tests/wpt/tree/2f96fa1996/webidl/ecmascript-binding/es-exceptions
- webmessaging/broadcastchannel: https://github.com/web-platform-tests/wpt/tree/6495c91853/webmessaging/broadcastchannel
Expand Down
36 changes: 36 additions & 0 deletions test/fixtures/wpt/WebCryptoAPI/getPublicKey.tentative.https.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,42 @@ const algorithms = [
generateKeyParams: { name: "X25519" },
usages: ["deriveKey", "deriveBits"],
publicKeyUsages: []
},
{
name: "ML-DSA-44",
generateKeyParams: { name: "ML-DSA-44" },
usages: ["sign", "verify"],
publicKeyUsages: ["verify"]
},
{
name: "ML-DSA-65",
generateKeyParams: { name: "ML-DSA-65" },
usages: ["sign", "verify"],
publicKeyUsages: ["verify"]
},
{
name: "ML-DSA-87",
generateKeyParams: { name: "ML-DSA-87" },
usages: ["sign", "verify"],
publicKeyUsages: ["verify"]
},
{
name: "ML-KEM-512",
generateKeyParams: { name: "ML-KEM-512" },
usages: ["encapsulateBits", "encapsulateKey", "decapsulateBits", "decapsulateKey"],
publicKeyUsages: ["encapsulateBits", "encapsulateKey"]
},
{
name: "ML-KEM-768",
generateKeyParams: { name: "ML-KEM-768" },
usages: ["encapsulateBits", "encapsulateKey", "decapsulateBits", "decapsulateKey"],
publicKeyUsages: ["encapsulateBits", "encapsulateKey"]
},
{
name: "ML-KEM-1024",
generateKeyParams: { name: "ML-KEM-1024" },
usages: ["encapsulateBits", "encapsulateKey", "decapsulateBits", "decapsulateKey"],
publicKeyUsages: ["encapsulateBits", "encapsulateKey"]
}
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@
const modernAlgorithms = {
// Asymmetric algorithms
'ML-DSA-44': {
operations: ['generateKey', 'importKey', 'sign', 'verify'],
operations: ['generateKey', 'importKey', 'sign', 'verify', 'getPublicKey'],
},
'ML-DSA-65': {
operations: ['generateKey', 'importKey', 'sign', 'verify'],
operations: ['generateKey', 'importKey', 'sign', 'verify', 'getPublicKey'],
},
'ML-DSA-87': {
operations: ['generateKey', 'importKey', 'sign', 'verify'],
operations: ['generateKey', 'importKey', 'sign', 'verify', 'getPublicKey'],
},
'ML-KEM-512': {
operations: [
'generateKey', 'importKey', 'encapsulateKey', 'encapsulateBits',
'decapsulateKey', 'decapsulateBits'
'decapsulateKey', 'decapsulateBits', 'getPublicKey'
],
},
'ML-KEM-768': {
operations: [
'generateKey', 'importKey', 'encapsulateKey', 'encapsulateBits',
'decapsulateKey', 'decapsulateBits'
'decapsulateKey', 'decapsulateBits', 'getPublicKey'
],
},
'ML-KEM-1024': {
operations: [
'generateKey', 'importKey', 'encapsulateKey', 'encapsulateBits',
'decapsulateKey', 'decapsulateBits'
'decapsulateKey', 'decapsulateBits', 'getPublicKey'
],
},

Expand All @@ -54,6 +54,7 @@ const operations = [
'encapsulateBits',
'decapsulateKey',
'decapsulateBits',
'getPublicKey',
];

// Test that supports method exists and is a static method
Expand Down
15 changes: 8 additions & 7 deletions test/fixtures/wpt/WebCryptoAPI/supports.tentative.https.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
const standardAlgorithms = {
// Asymmetric algorithms
'RSASSA-PKCS1-v1_5': {
operations: ['generateKey', 'importKey', 'sign', 'verify'],
operations: ['generateKey', 'importKey', 'sign', 'verify', 'getPublicKey'],
keyGenParams: {
name: 'RSASSA-PKCS1-v1_5',
modulusLength: 2048,
Expand All @@ -17,7 +17,7 @@ const standardAlgorithms = {
signParams: { name: 'RSASSA-PKCS1-v1_5' },
},
'RSA-PSS': {
operations: ['generateKey', 'importKey', 'sign', 'verify'],
operations: ['generateKey', 'importKey', 'sign', 'verify', 'getPublicKey'],
keyGenParams: {
name: 'RSA-PSS',
modulusLength: 2048,
Expand All @@ -28,7 +28,7 @@ const standardAlgorithms = {
signParams: { name: 'RSA-PSS', saltLength: 32 },
},
'RSA-OAEP': {
operations: ['generateKey', 'importKey', 'encrypt', 'decrypt'],
operations: ['generateKey', 'importKey', 'encrypt', 'decrypt', 'getPublicKey'],
keyGenParams: {
name: 'RSA-OAEP',
modulusLength: 2048,
Expand All @@ -39,13 +39,13 @@ const standardAlgorithms = {
encryptParams: { name: 'RSA-OAEP' },
},
ECDSA: {
operations: ['generateKey', 'importKey', 'sign', 'verify'],
operations: ['generateKey', 'importKey', 'sign', 'verify', 'getPublicKey'],
keyGenParams: { name: 'ECDSA', namedCurve: 'P-256' },
importParams: { name: 'ECDSA', namedCurve: 'P-256' },
signParams: { name: 'ECDSA', hash: 'SHA-256' },
},
ECDH: {
operations: ['generateKey', 'importKey', 'deriveBits'],
operations: ['generateKey', 'importKey', 'deriveBits', 'getPublicKey'],
keyGenParams: { name: 'ECDH', namedCurve: 'P-256' },
importParams: { name: 'ECDH', namedCurve: 'P-256' },
deriveBitsParams: {
Expand All @@ -58,12 +58,12 @@ const standardAlgorithms = {
},
},
Ed25519: {
operations: ['generateKey', 'importKey', 'sign', 'verify'],
operations: ['generateKey', 'importKey', 'sign', 'verify', 'getPublicKey'],
keyGenParams: null,
signParams: { name: 'Ed25519' },
},
X25519: {
operations: ['generateKey', 'importKey', 'deriveBits'],
operations: ['generateKey', 'importKey', 'deriveBits', 'getPublicKey'],
keyGenParams: null,
deriveBitsParams: {
name: 'X25519',
Expand Down Expand Up @@ -152,6 +152,7 @@ const operations = [
'decrypt',
'deriveBits',
'digest',
'getPublicKey',
];

// Test that supports method exists and is a static method
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/wpt/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"path": "web-locks"
},
"WebCryptoAPI": {
"commit": "97bbc7247a16231f4744a47a1d9b3d29633d5292",
"commit": "0c413fb56b9da8bf27502c866a3d60f93981804d",
"path": "WebCryptoAPI"
},
"webidl": {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-debugger-probe-bound-never-hit.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spawnSyncAndAssert(process.execPath, [
'--probe', 'probe-bound-never-hit.js:4',
'--expr', '1',
'probe-bound-never-hit.js',
], { cwd }, {
], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, {
stdout(output) {
assertProbeJson(output, {
v: 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spawnSyncAndAssert(process.execPath, [
'--',
'--inspect-port=0',
'probe.js',
], { cwd }, {
], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, {
stdout(output) {
assertProbeJson(output, {
v: 2,
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-debugger-probe-explicit-column.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spawnSyncAndAssert(process.execPath, [
'--probe', 'probe-multi-statement.js:5:29',
'--expr', 'acc.length',
'probe-multi-statement.js',
], { cwd }, {
], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, {
stdout(output) {
assertProbeJson(output, {
v: 2,
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-debugger-probe-expression-throws.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spawnSyncAndExit(process.execPath, [
'--probe', `${fixture}:16`, '--expr', probes[0].expr,
'--probe', `${fixture}:17`, '--expr', probes[1].expr,
fixture,
], { cwd }, {
], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, {
status: 0,
signal: null,
stdout(output) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spawnSyncAndExit(process.execPath, [
'--probe', `${fixture}:10`, '--expr', probes[0].expr,
'--probe', `${fixture}:11`, '--expr', probes[1].expr,
fixture,
], { cwd }, {
], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, {
status: 1,
signal: null,
stdout(output) {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-debugger-probe-failure-process-exit.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spawnSyncAndExit(process.execPath, [
'inspect', '--json',
'--probe', `${fixture}:8`, '--expr', probes[0].expr,
fixture,
], { cwd }, {
], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, {
status: 1,
signal: null,
stdout(output) {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-debugger-probe-global-option-order.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spawnSyncAndAssert(process.execPath, [
'--expr', 'finalValue',
'--json',
'probe.js',
], { cwd }, {
], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, {
stdout(output) {
assertProbeJson(output, {
v: 2,
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-debugger-probe-json-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spawnSyncAndAssert(process.execPath, [
'--probe', probeArg,
'--expr', 'errorValue',
'probe-types.js',
], { cwd }, {
], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, {
stdout(output) {
assertProbeJson(output, {
v: 2,
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-debugger-probe-json-special-values.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spawnSyncAndAssert(process.execPath, [
'--probe', probeArg,
'--expr', 'errorValue',
'probe-types.js',
], { cwd }, {
], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, {
stdout(output) {
assertProbeJson(output, {
v: 2,
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-debugger-probe-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spawnSyncAndAssert(process.execPath, [
'--probe', 'probe.js:12',
'--expr', 'finalValue',
'probe.js',
], { cwd }, {
], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, {
stdout(output) {
assertProbeJson(output, {
v: 2,
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-debugger-probe-late-resolution.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spawnSyncAndAssert(process.execPath, [
'--probe', 'probe-late-target.cjs:5',
'--expr', 'value',
'probe-late-entry.js',
], { cwd }, {
], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, {
stdout(output) {
assertProbeJson(output, {
v: 2,
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-debugger-probe-launch.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spawnSyncAndExit(process.execPath, [
'--',
'--not-a-real-node-flag',
'probe.js',
], { cwd }, {
], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, {
signal: null,
status: 1,
stderr(output) {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-debugger-probe-miss.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spawnSyncAndAssert(process.execPath, [
'--probe', 'probe-miss.js:99',
'--expr', '42',
'probe-miss.js',
], { cwd }, {
], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, {
stdout(output) {
assertProbeJson(output, {
v: 2,
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-debugger-probe-missing-expr.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spawnSyncAndExit(process.execPath, [
'inspect',
'--probe', 'probe.js:12',
'probe.js',
], { cwd }, {
], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, {
signal: null,
status: 9,
stderr: /Each --probe must be followed immediately by --expr/,
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-debugger-probe-multi-location.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spawnSyncAndAssert(process.execPath, [
'--probe', 'utils.js:5',
'--expr', 'b',
'probe-multi-entry.js',
], { cwd }, {
], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, {
stdout(output) {
assertProbeJson(output, {
v: 2,
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-debugger-probe-narrow-suffix.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spawnSyncAndAssert(process.execPath, [
'--probe', 'probe-multi-a/utils.js:5',
'--expr', 'b',
'probe-multi-entry.js',
], { cwd }, {
], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, {
stdout(output) {
assertProbeJson(output, {
v: 2,
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-debugger-probe-no-column-indent.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spawnSyncAndAssert(process.execPath, [
'--probe', 'probe-indented.js:6', // No `:col`
'--expr', 'x',
'probe-indented.js',
], { cwd }, {
], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, {
stdout(output) {
assertProbeJson(output, {
v: 2,
Expand Down
Loading
Loading