MCPcopy Create free account
hub / github.com/Snapchat/Valdi / getSyntaxErrorIn

Function getSyntaxErrorIn

valdi/vscode_debugger/src/common/sourceUtils.ts:340–346  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

338 * Returns the syntax error in the given code, if any.
339 */
340export function getSyntaxErrorIn(code: string): Error | void {
341 try {
342 new Function(code);
343 } catch (e) {
344 return e;
345 }
346}

Callers 3

constructorMethod · 0.90
compileMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected