Reviewed by Dimitri Glazkov.
Bug 26701: Implement the missing code for "FIXME: Need to return an
exception" in WorkerScriptController::evaluate for v8 bindings.
https://bugs.webkit.org/show_bug.cgi?id=26701
* bindings/v8/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::evaluate):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@45198
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2009-06-25 Jian Li <jianli@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Bug 26701: Implement the missing code for "FIXME: Need to return an
+ exception" in WorkerScriptController::evaluate for v8 bindings.
+ https://bugs.webkit.org/show_bug.cgi?id=26701
+
+ * bindings/v8/WorkerScriptController.cpp:
+ (WebCore::WorkerScriptController::evaluate):
+
2009-06-25 Nate Chapin <japhet@chromium.org>
Reviewed by Dimitri Glazkov.
return ScriptValue();
}
-ScriptValue WorkerScriptController::evaluate(const ScriptSourceCode& sourceCode, ScriptValue* /* exception */)
+ScriptValue WorkerScriptController::evaluate(const ScriptSourceCode& sourceCode, ScriptValue* exception)
{
- // FIXME: Need to return an exception.
- return evaluate(sourceCode);
+ v8::TryCatch exceptionCatcher;
+ ScriptValue result = evaluate(sourceCode);
+ if (exceptionCatcher.HasCaught()) {
+ *exception = ScriptValue(exceptionCatcher.Exception());
+ throwError(exceptionCatcher.Exception());
+ return ScriptValue();
+ } else
+ return result;
}
void WorkerScriptController::forbidExecution()