- RefPtr<ProgramNode> progNode = exec->globalData().parser->parse<ProgramNode>(exec, exec->dynamicGlobalObject()->debugger(), source, &errLine, &errMsg);
- if (!progNode)
- return Completion(Throw, Error::create(exec, SyntaxError, errMsg, errLine, source.provider()->asID(), source.provider()->url()));
- return Completion(Normal);
+ return true;
+}
+
+bool checkSyntax(VM& vm, const SourceCode& source, ParserError& error)
+{
+ JSLockHolder lock(vm);
+ RELEASE_ASSERT(vm.identifierTable == wtfThreadData().currentIdentifierTable());
+ RefPtr<ProgramNode> programNode = parse<ProgramNode>(&vm, source, 0, Identifier(), JSParseNormal, JSParseProgramCode, error);
+ return programNode;