summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/v8/V8Utilities.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/v8/V8Utilities.cpp')
-rw-r--r--WebCore/bindings/v8/V8Utilities.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/WebCore/bindings/v8/V8Utilities.cpp b/WebCore/bindings/v8/V8Utilities.cpp
index c547cc7..fb1ecaa 100644
--- a/WebCore/bindings/v8/V8Utilities.cpp
+++ b/WebCore/bindings/v8/V8Utilities.cpp
@@ -134,13 +134,15 @@ ScriptExecutionContext* getScriptExecutionContext(ScriptState* scriptState)
return proxy->workerContext()->scriptExecutionContext();
#endif
- if (scriptState)
- return scriptState->frame()->document()->scriptExecutionContext();
- else {
- Frame* frame = V8Proxy::retrieveFrameForCurrentContext();
- if (frame)
- return frame->document()->scriptExecutionContext();
- }
+ Frame* frame;
+ if (scriptState) {
+ v8::HandleScope handleScope;
+ frame = V8Proxy::retrieveFrame(scriptState->context());
+ } else
+ frame = V8Proxy::retrieveFrameForCurrentContext();
+
+ if (frame)
+ return frame->document()->scriptExecutionContext();
return 0;
}
@@ -170,7 +172,7 @@ void reportException(ScriptState* scriptState, v8::TryCatch& exceptionCatcher)
ScriptExecutionContext* context = getScriptExecutionContext(scriptState);
// During the frame teardown, there may not be a valid context.
if (context && !context->isDocument())
- context->reportException(errorMessage, lineNumber, sourceURL);
+ context->reportException(errorMessage, lineNumber, sourceURL);
exceptionCatcher.Reset();
}