X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/9dae56ea45a0f5f8136a5c93d6f3a7f99399ca73..ba379fdc102753d6be2c4d937058fe40257329fe:/API/JSBase.cpp?ds=inline diff --git a/API/JSBase.cpp b/API/JSBase.cpp index 2ffe345..fc3d0fe 100644 --- a/API/JSBase.cpp +++ b/API/JSBase.cpp @@ -55,15 +55,15 @@ JSValueRef JSEvaluateScript(JSContextRef ctx, JSStringRef script, JSObjectRef th if (completion.complType() == Throw) { if (exception) - *exception = toRef(completion.value()); + *exception = toRef(exec, completion.value()); return 0; } - + if (completion.value()) - return toRef(completion.value()); + return toRef(exec, completion.value()); // happens, for example, when the only statement is an empty (';') statement - return toRef(jsUndefined()); + return toRef(exec, jsUndefined()); } bool JSCheckScriptSyntax(JSContextRef ctx, JSStringRef script, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception) @@ -76,7 +76,7 @@ bool JSCheckScriptSyntax(JSContextRef ctx, JSStringRef script, JSStringRef sourc Completion completion = checkSyntax(exec->dynamicGlobalObject()->globalExec(), source); if (completion.complType() == Throw) { if (exception) - *exception = toRef(completion.value()); + *exception = toRef(exec, completion.value()); return false; }