mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
Fix #57897 ignore object valued scripts
This commit is contained in:
parent
cd20626929
commit
295f04ae24
|
@ -352,6 +352,7 @@ async function findAllScripts(buffer: string): Promise<StringMap> {
|
|||
|
||||
let visitor: JSONVisitor = {
|
||||
onError(_error: ParseErrorCode, _offset: number, _length: number) {
|
||||
console.log(_error);
|
||||
},
|
||||
onObjectEnd() {
|
||||
if (inScripts) {
|
||||
|
@ -368,8 +369,10 @@ async function findAllScripts(buffer: string): Promise<StringMap> {
|
|||
if (property === 'scripts') {
|
||||
inScripts = true;
|
||||
}
|
||||
else if (inScripts) {
|
||||
else if (inScripts && !script) {
|
||||
script = property;
|
||||
} else { // nested object which is invalid, ignore the script
|
||||
script = undefined;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue