Don't use spread operator when pushing arrays onto other arrays.
Spreading emits as ".push.apply(reciver, values)". This pushes every elements in values onto the stack before calling the function. This can easily stack overflow if the amount of values is high (i hit this with ~10k values on my own system).
This commit is contained in:
parent
6db4faf488
commit
ede80c1de2
1 changed files with 3 additions and 9 deletions
|
@ -1789,11 +1789,6 @@ namespace ts {
|
||||||
sourceFile.moduleName = moduleName;
|
sourceFile.moduleName = moduleName;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store syntactic diagnostics
|
|
||||||
if (diagnostics && sourceFile.parseDiagnostics) {
|
|
||||||
diagnostics.push(...sourceFile.parseDiagnostics);
|
|
||||||
}
|
|
||||||
|
|
||||||
let newLine = getNewLineCharacter(options);
|
let newLine = getNewLineCharacter(options);
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
|
@ -1815,9 +1810,8 @@ namespace ts {
|
||||||
|
|
||||||
var program = createProgram([inputFileName], options, compilerHost);
|
var program = createProgram([inputFileName], options, compilerHost);
|
||||||
|
|
||||||
if (diagnostics) {
|
addRange(/*to*/ diagnostics, /*from*/ sourceFile.parseDiagnostics);
|
||||||
diagnostics.push(...program.getCompilerOptionsDiagnostics());
|
addRange(/*to*/ diagnostics, /*from*/ program.getCompilerOptionsDiagnostics());
|
||||||
}
|
|
||||||
|
|
||||||
// Emit
|
// Emit
|
||||||
program.emit();
|
program.emit();
|
||||||
|
@ -4188,7 +4182,7 @@ namespace ts {
|
||||||
var result: DefinitionInfo[] = [];
|
var result: DefinitionInfo[] = [];
|
||||||
forEach((<UnionType>type).types, t => {
|
forEach((<UnionType>type).types, t => {
|
||||||
if (t.symbol) {
|
if (t.symbol) {
|
||||||
result.push(...getDefinitionFromSymbol(t.symbol, node));
|
addRange(/*to*/ result, /*from*/ getDefinitionFromSymbol(t.symbol, node));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in a new issue