Index: Source/bindings/v8/V8Binding.cpp |
diff --git a/Source/bindings/v8/V8Binding.cpp b/Source/bindings/v8/V8Binding.cpp |
index 5abfe4412209609e9b3989f080d26744e75160dd..8200011efba8cda6d62bfeefa3f7e396fc42fc4d 100644 |
--- a/Source/bindings/v8/V8Binding.cpp |
+++ b/Source/bindings/v8/V8Binding.cpp |
@@ -590,4 +590,16 @@ v8::Local<v8::Value> getHiddenValueFromMainWorldWrapper(v8::Isolate* isolate, Sc |
return wrapper.IsEmpty() ? v8::Local<v8::Value>() : wrapper->GetHiddenValue(key); |
} |
+v8::Isolate* getIsolateFromScriptExecutionContext(ScriptExecutionContext* context) |
+{ |
+ ASSERT(context); |
+ if (context->isDocument()) { |
+ static v8::Isolate* mainWorldIsolate = 0; |
+ if (!mainWorldIsolate) |
+ mainWorldIsolate = v8::Isolate::GetCurrent(); |
+ return mainWorldIsolate; |
+ } |
+ return v8::Isolate::GetCurrent(); |
+} |
+ |
} // namespace WebCore |