Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 5fb99c68b0b46d7a93eaa7a743dd53c905d2e7b9..45c5d467d3143420408f858c91e6baa7e0d304ea 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -5421,6 +5421,31 @@ TEST(TryCatchNative) { |
} |
+void TryCatchNativeResetHelper( |
+ const v8::FunctionCallbackInfo<v8::Value>& args) { |
+ ApiTestFuzzer::Fuzz(); |
+ v8::TryCatch try_catch; |
+ args.GetIsolate()->ThrowException(v8_str("boom")); |
+ CHECK(try_catch.HasCaught()); |
+ try_catch.Reset(); |
+ CHECK(!try_catch.HasCaught()); |
+} |
+ |
+ |
+TEST(TryCatchNativeReset) { |
+ v8::Isolate* isolate = CcTest::isolate(); |
+ v8::HandleScope scope(isolate); |
+ v8::V8::Initialize(); |
+ v8::TryCatch try_catch; |
+ Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); |
+ templ->Set(v8_str("TryCatchNativeResetHelper"), |
+ v8::FunctionTemplate::New(isolate, TryCatchNativeResetHelper)); |
+ LocalContext context(0, templ); |
+ CompileRun("TryCatchNativeResetHelper();"); |
+ CHECK(!try_catch.HasCaught()); |
+} |
+ |
+ |
THREADED_TEST(Equality) { |
LocalContext context; |
v8::Isolate* isolate = context->GetIsolate(); |