Skip to content

Commit cc3e62f

Browse files
committed
JS: Move stack trace limit to top of file
1 parent cf78475 commit cc3e62f

File tree

1 file changed

+3
-1
lines changed
  • javascript/extractor/lib/typescript/src

1 file changed

+3
-1
lines changed

javascript/extractor/lib/typescript/src/main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ import { Project } from "./common";
4141
import { TypeTable } from "./type_table";
4242
import { VirtualSourceRoot } from "./virtual_source_root";
4343

44+
// Remove limit on stack trace depth.
45+
Error.stackTraceLimit = Infinity;
46+
4447
interface ParseCommand {
4548
command: "parse";
4649
filename: string;
@@ -364,7 +367,6 @@ function parseSingleFile(filename: string): {ast: ts.SourceFile, code: string} {
364367
const nodeModulesRex = /[/\\]node_modules[/\\]((?:@[\w.-]+[/\\])?\w[\w.-]*)[/\\](.*)/;
365368

366369
function handleOpenProjectCommand(command: OpenProjectCommand) {
367-
Error.stackTraceLimit = Infinity;
368370
let tsConfigFilename = String(command.tsConfig);
369371
let tsConfig = ts.readConfigFile(tsConfigFilename, ts.sys.readFile);
370372
let basePath = pathlib.dirname(tsConfigFilename);

0 commit comments

Comments
 (0)