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"); |
+} |