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

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

Issue 2674103002: [runtime] Skip feedback vector configuration. (Closed)
Patch Set: Add regression test. Created 3 years, 10 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 | « src/runtime/runtime-scopes.cc ('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-interceptors.cc
diff --git a/test/cctest/test-api-interceptors.cc b/test/cctest/test-api-interceptors.cc
index f1238620af1d970be6f69b9bcc8c7d1504b73fed..0038e9ffb04c920ae20924f9f92aab531c88eb03 100644
--- a/test/cctest/test-api-interceptors.cc
+++ b/test/cctest/test-api-interceptors.cc
@@ -495,6 +495,12 @@ void SetterCallback(Local<Name> property, Local<Value> value,
set_was_called_counter++;
}
+void InterceptingSetterCallback(
+ Local<Name> property, Local<Value> value,
+ const v8::PropertyCallbackInfo<v8::Value>& info) {
+ info.GetReturnValue().Set(value);
+}
+
} // namespace
// Check that get callback is called in defineProperty with accessor descriptor.
@@ -596,6 +602,25 @@ THREADED_TEST(InterceptorFunctionRedeclareWithQueryCallback) {
v8::Script::Compile(ctx, code).ToLocalChecked()->Run(ctx).ToLocalChecked();
}
+// Regression test for chromium bug 656648.
+// Do not crash on non-masking, intercepting setter callbacks.
+THREADED_TEST(NonMaskingInterceptor) {
+ v8::HandleScope scope(CcTest::isolate());
+ LocalContext env;
+ v8::Local<v8::FunctionTemplate> templ =
+ v8::FunctionTemplate::New(CcTest::isolate());
+
+ v8::Local<ObjectTemplate> object_template = templ->InstanceTemplate();
+ object_template->SetHandler(v8::NamedPropertyHandlerConfiguration(
+ nullptr, InterceptingSetterCallback, nullptr, nullptr, nullptr,
+ Local<Value>(), v8::PropertyHandlerFlags::kNonMasking));
+ v8::Local<v8::Context> ctx =
+ v8::Context::New(CcTest::isolate(), nullptr, object_template);
+
+ v8::Local<v8::String> code = v8_str("function x() {return 43;};");
+ v8::Script::Compile(ctx, code).ToLocalChecked()->Run(ctx).ToLocalChecked();
+}
+
// Check that function re-declarations throw if they are read-only.
THREADED_TEST(SetterCallbackFunctionDeclarationInterceptorThrow) {
v8::HandleScope scope(CcTest::isolate());
« no previous file with comments | « src/runtime/runtime-scopes.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698