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

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

Issue 3462005: Fix getOwnPropertyDescriptor() support for index properties. (Closed)
Patch Set: Created 10 years, 3 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
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index d18667018d4bb8baec8f5866372ae138464e6493..b0421234cc71dac91c3df0bf876c012ad6f7bd7e 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -3022,6 +3022,27 @@ static v8::Handle<Value> IdentityIndexedPropertyGetter(
}
+THREADED_TEST(IndexedInterceptorWithGetOwnPropertyDescriptor) {
+ v8::HandleScope scope;
+ Local<ObjectTemplate> templ = ObjectTemplate::New();
+ templ->SetIndexedPropertyHandler(IdentityIndexedPropertyGetter);
antonm 2010/09/22 13:26:38 you probably need to extend this test case for cas
+
+ LocalContext context;
+ context->Global()->Set(v8_str("obj"), templ->NewInstance());
+
+ // Check fast object case.
+ const char* fast_case_code =
+ "Object.getOwnPropertyDescriptor(obj, 0).value.toString()";
+ ExpectString(fast_case_code, "0");
+
+ // Check slow case.
+ const char* slow_case_code =
+ "obj.x = 1; delete obj.x;"
+ "Object.getOwnPropertyDescriptor(obj, 1).value.toString()";
+ ExpectString(slow_case_code, "1");
+}
+
+
THREADED_TEST(IndexedInterceptorWithNoSetter) {
v8::HandleScope scope;
Local<ObjectTemplate> templ = ObjectTemplate::New();
« src/runtime.cc ('K') | « src/runtime.cc ('k') | test/mjsunit/regress/regress-874.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698