X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/b37bf2e156556c589aea3e1f58a377f2b1189665..b5422865f473faf3977f31b96a635c4c8c4ede09:/API/JSBase.cpp?ds=inline diff --git a/API/JSBase.cpp b/API/JSBase.cpp index d8acc42..65f2128 100644 --- a/API/JSBase.cpp +++ b/API/JSBase.cpp @@ -28,6 +28,7 @@ #include "JSBase.h" #include "APICast.h" +#include "SourceCode.h" #include #include #include @@ -43,8 +44,9 @@ JSValueRef JSEvaluateScript(JSContextRef ctx, JSStringRef script, JSObjectRef th JSObject* jsThisObject = toJS(thisObject); UString::Rep* scriptRep = toJS(script); UString::Rep* sourceURLRep = sourceURL ? toJS(sourceURL) : &UString::Rep::null; + SourceCode source = makeSource(UString(scriptRep), UString(sourceURLRep), startingLineNumber); // Interpreter::evaluate sets "this" to the global object if it is NULL - Completion completion = Interpreter::evaluate(exec->dynamicGlobalObject()->globalExec(), UString(sourceURLRep), startingLineNumber, UString(scriptRep), jsThisObject); + Completion completion = Interpreter::evaluate(exec->dynamicGlobalObject()->globalExec(), source, jsThisObject); if (completion.complType() == Throw) { if (exception) @@ -66,7 +68,8 @@ bool JSCheckScriptSyntax(JSContextRef ctx, JSStringRef script, JSStringRef sourc ExecState* exec = toJS(ctx); UString::Rep* scriptRep = toJS(script); UString::Rep* sourceURLRep = sourceURL ? toJS(sourceURL) : &UString::Rep::null; - Completion completion = Interpreter::checkSyntax(exec->dynamicGlobalObject()->globalExec(), UString(sourceURLRep), startingLineNumber, UString(scriptRep)); + SourceCode source = makeSource(UString(scriptRep), UString(sourceURLRep), startingLineNumber); + Completion completion = Interpreter::checkSyntax(exec->dynamicGlobalObject()->globalExec(), source); if (completion.complType() == Throw) { if (exception) *exception = toRef(completion.value());