mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
JS: Tolerate TypeScript files being requested out of order
This commit is contained in:
@@ -361,7 +361,10 @@ function handleParseCommand(command: ParseCommand, checkPending = true) {
|
||||
let filename = command.filename;
|
||||
let expectedFilename = state.pendingFiles[state.pendingFileIndex];
|
||||
if (expectedFilename !== filename && checkPending) {
|
||||
throw new Error("File requested out of order. Expected '" + expectedFilename + "' but got '" + filename + "'");
|
||||
// File was requested out of order. This happens in rare cases because the Java process decided against extracting it,
|
||||
// for example because it was too large. Just recover and accept that some work was wasted.
|
||||
state.pendingResponse = null;
|
||||
state.pendingFileIndex = state.pendingFiles.indexOf(filename);
|
||||
}
|
||||
++state.pendingFileIndex;
|
||||
let response = state.pendingResponse || extractFile(command.filename);
|
||||
|
||||
Reference in New Issue
Block a user