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

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

Issue 1960663002: Convert primitive receivers for API property callbacks (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
« src/accessors.cc ('K') | « src/objects-inl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-accessors.cc
diff --git a/test/cctest/test-accessors.cc b/test/cctest/test-accessors.cc
index 90ea08144d9ccde1f31095bc9a23834d9fcaca39..67803eeed607fc7f37e981a86b39df3b7d31f192 100644
--- a/test/cctest/test-accessors.cc
+++ b/test/cctest/test-accessors.cc
@@ -774,3 +774,28 @@ TEST(PrototypeGetterAccessCheck) {
CHECK(try_catch.HasCaught());
}
}
+
+static void check_receiver(Local<String> name,
+ const v8::PropertyCallbackInfo<v8::Value>& info) {
+ CHECK(info.This()->IsObject());
+}
+
+TEST(Regress609134) {
+ v8::internal::FLAG_allow_natives_syntax = true;
+ LocalContext env;
+ v8::Isolate* isolate = env->GetIsolate();
+ v8::HandleScope scope(isolate);
+ auto fun_templ = v8::FunctionTemplate::New(isolate);
+ fun_templ->InstanceTemplate()->SetNativeDataProperty(v8_str("foo"),
+ check_receiver);
+
+ 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;"
+ "[42][0].foo");
+}
« src/accessors.cc ('K') | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698