Skip to content

Commit 0d8afbe

Browse files
paldepindCopilot
andcommitted
JavaScript: classify parser crashes consistently after pipe errors
Use the existing wrapper exit-code classification after IPC errors, avoiding a race between native prefetch failure and Java's next request. Preserve the communication-error fallback for a live wrapper. Record successful Linux and Windows runtime execution coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 86598cdc-5945-4d8e-9ea4-eeb4eb4356ba
1 parent 5424a90 commit 0d8afbe

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

‎javascript/extractor/lib/typescript/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ executable permissions using their central-directory metadata.
9191

9292
All four distribution runtime ZIPs have been cross-assembled and inspected.
9393
Installed parsing has been verified with Node.js 18.15.0 on macOS arm64 and on
94-
macOS x64 through Rosetta. Linux x64, Linux arm64, and Windows x64 still require
95-
execution on matching hosts; cross-assembling their ZIPs is not execution coverage.
94+
macOS x64 through Rosetta. CI integration tests have also passed on Linux x64,
95+
Linux arm64, and Windows x64, including Windows 2022.
9696

9797
Native lifecycle and memory
9898
---------------------------

‎javascript/extractor/src/com/semmle/ts/extractor/TypeScriptParser.java‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -369,12 +369,7 @@ private JsonObject talkToParserWrapper(JsonObject request) {
369369
throw getExceptionFromMalformedResponse(response, e);
370370
}
371371
} catch (IOException e) {
372-
throw new CatastrophicError(
373-
"Could not communicate with TypeScript parser wrapper "
374-
+ "(command: ."
375-
+ parserWrapperCommand
376-
+ ").",
377-
e);
372+
throw getExceptionFromMalformedResponse(response, e);
378373
}
379374
}
380375

@@ -401,6 +396,14 @@ private RuntimeException getExceptionFromMalformedResponse(String response, Exce
401396
} catch (InterruptedException e1) {
402397
Exceptions.ignore(e, "This is for diagnostic purposes only.");
403398
}
399+
if (e instanceof IOException) {
400+
return new CatastrophicError(
401+
"Could not communicate with TypeScript parser wrapper "
402+
+ "(command: ."
403+
+ parserWrapperCommand
404+
+ ").",
405+
e);
406+
}
404407
if (response == null) {
405408
return new CatastrophicError("No response from TypeScript parser wrapper", e);
406409
}

0 commit comments

Comments
 (0)