Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 0ee53ba8abe69ff385d1f166772ac4cdd00d24d3..9d7793797d640ec13097971279aec3f1da1e08e9 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -21645,3 +21645,37 @@ 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); |
+ |
+ // Just to silence warning |
+ CHECK(!obj.IsEmpty()); |
Yang
2015/03/13 07:18:20
You can use 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); |
+ |
+ // Just to silence warning |
+ CHECK(!obj.IsEmpty()); |
Yang
2015/03/13 07:18:20
Same here.
|
+ } |
+} |