Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 8f96a4a9d1637784c0cc1175bfb72a6af7a993f3..5debeeb33ed98465436e364e4c778e4e7647234f 100755 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -14315,6 +14315,18 @@ static v8::Handle<Value> GetCallingContextCallback(const v8::Arguments& args) { |
} |
+THREADED_TEST(GetCurrentContextWhenNotInContext) { |
+ i::Isolate* isolate = i::Isolate::Current(); |
+ CHECK(isolate != NULL); |
+ CHECK(isolate->context() == NULL); |
+ v8::Isolate* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate); |
+ v8::HandleScope scope(v8_isolate); |
+ // The following should not crash, but return an empty handle. |
+ v8::Local<v8::Context> current = v8_isolate->GetCurrentContext(); |
+ CHECK(current.IsEmpty()); |
+} |
+ |
+ |
THREADED_TEST(GetCallingContext) { |
v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
v8::HandleScope scope(isolate); |