From 41386e9cb918eed93b3f13648cbef387e371e451 Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Wed, 20 May 2015 09:56:07 +0000 Subject: webkitgtk-2.4.9 --- Source/JavaScriptCore/runtime/Completion.cpp | 41 +++++++++------------------- 1 file changed, 13 insertions(+), 28 deletions(-) (limited to 'Source/JavaScriptCore/runtime/Completion.cpp') diff --git a/Source/JavaScriptCore/runtime/Completion.cpp b/Source/JavaScriptCore/runtime/Completion.cpp index a3daee603..9d7fd1a74 100644 --- a/Source/JavaScriptCore/runtime/Completion.cpp +++ b/Source/JavaScriptCore/runtime/Completion.cpp @@ -26,13 +26,10 @@ #include "CallFrame.h" #include "CodeProfiling.h" #include "Debugger.h" -#include "Exception.h" #include "Interpreter.h" #include "JSGlobalObject.h" #include "JSLock.h" -#include "JSCInlines.h" -#include "ModuleAnalyzer.h" -#include "ModuleRecord.h" +#include "Operations.h" #include "Parser.h" #include @@ -41,7 +38,7 @@ namespace JSC { bool checkSyntax(ExecState* exec, const SourceCode& source, JSValue* returnedException) { JSLockHolder lock(exec); - RELEASE_ASSERT(exec->vm().atomicStringTable() == wtfThreadData().atomicStringTable()); + RELEASE_ASSERT(exec->vm().identifierTable == wtfThreadData().currentIdentifierTable()); ProgramExecutable* program = ProgramExecutable::create(exec, source); JSObject* error = program->checkSyntax(exec); @@ -57,38 +54,24 @@ bool checkSyntax(ExecState* exec, const SourceCode& source, JSValue* returnedExc bool checkSyntax(VM& vm, const SourceCode& source, ParserError& error) { JSLockHolder lock(vm); - RELEASE_ASSERT(vm.atomicStringTable() == wtfThreadData().atomicStringTable()); - return !!parse( - &vm, source, Identifier(), JSParserBuiltinMode::NotBuiltin, - JSParserStrictMode::NotStrict, SourceParseMode::ProgramMode, error); + RELEASE_ASSERT(vm.identifierTable == wtfThreadData().currentIdentifierTable()); + RefPtr programNode = parse(&vm, source, 0, Identifier(), JSParseNormal, JSParseProgramCode, error); + return programNode; } -bool checkModuleSyntax(VM& vm, const SourceCode& source, ParserError& error) -{ - JSLockHolder lock(vm); - RELEASE_ASSERT(vm.atomicStringTable() == wtfThreadData().atomicStringTable()); - std::unique_ptr moduleProgramNode = parse( - &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; -} - -JSValue evaluate(ExecState* exec, const SourceCode& source, JSValue thisValue, NakedPtr& returnedException) +JSValue evaluate(ExecState* exec, const SourceCode& source, JSValue thisValue, JSValue* returnedException) { JSLockHolder lock(exec); - RELEASE_ASSERT(exec->vm().atomicStringTable() == wtfThreadData().atomicStringTable()); + RELEASE_ASSERT(exec->vm().identifierTable == wtfThreadData().currentIdentifierTable()); RELEASE_ASSERT(!exec->vm().isCollectorBusy()); CodeProfiling profile(source); ProgramExecutable* program = ProgramExecutable::create(exec, source); if (!program) { - returnedException = exec->vm().exception(); + if (returnedException) + *returnedException = exec->vm().exception(); + exec->vm().clearException(); return jsUndefined(); } @@ -99,7 +82,9 @@ JSValue evaluate(ExecState* exec, const SourceCode& source, JSValue thisValue, N JSValue result = exec->interpreter()->execute(program, exec, thisObj); if (exec->hadException()) { - returnedException = exec->exception(); + if (returnedException) + *returnedException = exec->exception(); + exec->clearException(); return jsUndefined(); } -- cgit v1.2.1