bool checkSyntax(VM& vm, const SourceCode& source, ParserError& error) { JSLockHolder lock(vm); RELEASE_ASSERT(vm.atomicStringTable() == wtfThreadData().atomicStringTable()); return !!parse<ProgramNode>( &vm, source, Identifier(), JSParserBuiltinMode::NotBuiltin, JSParserStrictMode::NotStrict, SourceParseMode::ProgramMode, SuperBinding::NotNeeded, error); }
bool checkModuleSyntax(VM& vm, const SourceCode& source, ParserError& error) { JSLockHolder lock(vm); RELEASE_ASSERT(vm.atomicStringTable() == wtfThreadData().atomicStringTable()); std::unique_ptr<ModuleProgramNode> moduleProgramNode = parse<ModuleProgramNode>( &vm, source, Identifier(), JSParserBuiltinMode::NotBuiltin, JSParserStrictMode::Strict, SourceParseMode::ModuleAnalyzeMode, error); if (!moduleProgramNode) return false; ModuleAnalyzer moduleAnalyzer(vm, moduleProgramNode->varDeclarations(), moduleProgramNode->lexicalVariables()); moduleAnalyzer.analyze(*moduleProgramNode); return true; }
bool checkSyntax(VM& vm, const SourceCode& source, ParserError& error) { JSLockHolder lock(vm); RELEASE_ASSERT(vm.atomicStringTable() == wtfThreadData().atomicStringTable()); return !!parse<ProgramNode>(&vm, source, 0, Identifier(), JSParseNormal, JSParseProgramCode, error); }