Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index f7cbb8294d66d958ee16762a2b64c23646272e8f..5f9612ee41eb51e594d2aff0d8e7eed9f83e9e93 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -21900,3 +21900,35 @@ TEST(NewStringRangeError) { |
} |
free(buffer); |
} |
+ |
+ |
+TEST(SealHandleScope) { |
+ v8::Isolate* isolate = CcTest::isolate(); |
+ v8::HandleScope handle_scope(isolate); |
+ LocalContext env; |
+ |
+ v8::SealHandleScope seal(isolate); |
+ |
+ // Should fail |
+ v8::Local<v8::Object> obj = v8::Object::New(isolate); |
+ |
+ USE(obj); |
+} |
+ |
+ |
+TEST(SealHandleScopeNested) { |
+ v8::Isolate* isolate = CcTest::isolate(); |
+ v8::HandleScope handle_scope(isolate); |
+ LocalContext env; |
+ |
+ v8::SealHandleScope seal(isolate); |
+ |
+ { |
+ v8::HandleScope handle_scope(isolate); |
+ |
+ // Should work |
+ v8::Local<v8::Object> obj = v8::Object::New(isolate); |
+ |
+ USE(obj); |
+ } |
+} |