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

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

Issue 1156573002: [strong] Implement per-object restrictions behaviour of delete operator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: cl feedback Created 5 years, 7 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
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index e6c83849ae4881400eddc34ec268e0e51423c773..c93bc0ac582e408893c73a6e74eff4dcc2b5ec7d 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -21108,6 +21108,27 @@ TEST(StrongModeArityCallFromApi2) {
}
+TEST(StrongObjectDelete) {
+ i::FLAG_strong_mode = true;
+ LocalContext env;
+ v8::Isolate* isolate = env->GetIsolate();
+ v8::HandleScope scope(isolate);
+ Local<Object> obj;
+ {
+ v8::TryCatch try_catch;
+ obj = Local<Object>::Cast(CompileRun(
+ "function f(x) { 'use strong'; }"
+ "f"));
+
+ CHECK(!try_catch.HasCaught());
+ }
+ obj->ForceSet(v8_str("foo"), v8_num(1), v8::None);
+ obj->ForceSet(v8_num(2), v8_num(1), v8::None);
+ CHECK(!obj->Delete(v8_str("foo")));
+ CHECK(!obj->Delete(2));
+}
+
+
TEST(ExtrasExportsObject) {
v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope handle_scope(isolate);

Powered by Google App Engine
This is Rietveld 408576698