Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 9b1d01cd8f4ead1bab6e46f03c3ed362157f8c13..5cf43f4a551dd6ca46c955eb8b7953abfaee0ac7 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -6538,10 +6538,11 @@ 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); |
+ i::Context* context = internal_isolate->context(); |
+ if (context == NULL) return Local<Context>(); |
+ i::Context* native_context = context->global_object()->native_context(); |
+ if (native_context == NULL) return Local<Context>(); |
+ return Utils::ToLocal(i::Handle<i::Context>(native_context)); |
} |