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

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

Issue 1973513002: Interceptors expect the receiver to always be an JSReceiver. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 4 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
« no previous file with comments | « test/cctest/test-accessors.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 ac54ededca99a13b8ff124a111250564192d007e..a1894fad1adce45332c10042038131bde0ffe0c1 100644
--- a/test/cctest/test-api-interceptors.cc
+++ b/test/cctest/test-api-interceptors.cc
@@ -3888,3 +3888,28 @@ THREADED_TEST(NonMaskingInterceptorGlobalEvalRegression) {
"eval('obj.x');",
9);
}
+
+static void CheckReceiver(Local<Name> name,
+ const v8::PropertyCallbackInfo<v8::Value>& info) {
+ CHECK(info.This()->IsObject());
+}
+
+TEST(Regress609134Interceptor) {
+ LocalContext env;
+ v8::Isolate* isolate = env->GetIsolate();
+ v8::HandleScope scope(isolate);
+ auto fun_templ = v8::FunctionTemplate::New(isolate);
+ fun_templ->InstanceTemplate()->SetHandler(
+ v8::NamedPropertyHandlerConfiguration(CheckReceiver));
+
+ CHECK(env->Global()
+ ->Set(env.local(), v8_str("Fun"),
+ fun_templ->GetFunction(env.local()).ToLocalChecked())
+ .FromJust());
+
+ CompileRun(
+ "var f = new Fun();"
+ "Number.prototype.__proto__ = f;"
+ "var a = 42;"
+ "for (var i = 0; i<3; i++) { a.foo; }");
+}
« no previous file with comments | « test/cctest/test-accessors.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698