Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1277)

Unified Diff: test/cctest/test-api.cc

Issue 985873002: api: introduce SealHandleScope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixes Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/cctest.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 0ee53ba8abe69ff385d1f166772ac4cdd00d24d3..00a83e3babd5dd7275e3e181ed33c93bb3fa0483 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -21645,3 +21645,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(ob);
+}
+
+
+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(ob);
+ }
+}
« no previous file with comments | « test/cctest/cctest.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698