Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 65663ba5c66c6dfcb1e210d31949fa59ed642d71..178eeabe02a3138dd7285fdaa3f3737ba62b9e2a 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -5813,6 +5813,15 @@ CpuProfiler* Isolate::GetCpuProfiler() { |
} |
+v8::Local<v8::Context> Isolate::GetCurrentContext() { |
+ i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(this); |
+ i::Handle<i::Object> current = internal_isolate->native_context(); |
+ if (current.is_null()) return Local<Context>(); |
+ i::Handle<i::Context> context = i::Handle<i::Context>::cast(current); |
+ return Utils::ToLocal(context); |
+} |
+ |
+ |
void V8::SetGlobalGCPrologueCallback(GCCallback callback) { |
i::Isolate* isolate = i::Isolate::Current(); |
if (IsDeadCheck(isolate, "v8::V8::SetGlobalGCPrologueCallback()")) return; |