Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 6b55d7a7b836878bbed6eaa76da210e542e19329..df5938d8b8f60a18ebbdbdd9b1126fceb5dde944 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -2004,6 +2004,27 @@ THREADED_TEST(EmptyInterceptorDoesNotShadowAccessors) { |
} |
+THREADED_TEST(ExecutableAccessorIsPreservedOnAttributeChange) { |
+ v8::Isolate* isolate = CcTest::isolate(); |
+ v8::HandleScope scope(isolate); |
+ LocalContext env; |
+ v8::Local<v8::Value> res = CompileRun("var a = []; a;"); |
+ i::Handle<i::JSObject> a(v8::Utils::OpenHandle(v8::Object::Cast(*res))); |
+ CHECK(a->map()->instance_descriptors()->IsFixedArray()); |
+ CHECK_GT(i::FixedArray::cast(a->map()->instance_descriptors())->length(), 0); |
+ CompileRun("Object.defineProperty(a, 'length', { writable: false });"); |
+ CHECK_EQ(i::FixedArray::cast(a->map()->instance_descriptors())->length(), 0); |
+ // But we should still have an ExecutableAccessorInfo. |
+ i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
+ i::LookupResult lookup(i_isolate); |
+ i::Handle<i::String> name(v8::Utils::OpenHandle(*v8_str("length"))); |
+ a->LookupOwnRealNamedProperty(name, &lookup); |
+ CHECK(lookup.IsPropertyCallbacks()); |
+ i::Handle<i::Object> callback(lookup.GetCallbackObject(), i_isolate); |
+ CHECK(callback->IsExecutableAccessorInfo()); |
+} |
+ |
+ |
THREADED_TEST(EmptyInterceptorBreakTransitions) { |
v8::HandleScope scope(CcTest::isolate()); |
Handle<FunctionTemplate> templ = FunctionTemplate::New(CcTest::isolate()); |