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

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

Issue 1079713002: api: introduce SealHandleScope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix typo in a test Created 5 years, 8 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 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);
+ }
+}
« 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