From: olehougaard Date: Fri, 31 Oct 2008 11:53:29 +0000 (+0000) Subject: Fixing propertyIsEnumerable for properties that are *both* enumerable and read-only. X-Git-Tag: upstream/4.7.83~25059 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bf3efa1c726427caa0d868b562a88aa74f7bb7e0;p=platform%2Fupstream%2Fv8.git Fixing propertyIsEnumerable for properties that are *both* enumerable and read-only. Review URL: http://codereview.chromium.org/8962 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@670 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/runtime.cc b/src/runtime.cc index 197aae607..a1d6a9d01 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -1934,7 +1934,7 @@ static Object* Runtime_IsPropertyEnumerable(Arguments args) { } PropertyAttributes att = object->GetLocalPropertyAttribute(key); - return Heap::ToBoolean(att != ABSENT && att != DONT_ENUM); + return Heap::ToBoolean(att != ABSENT && (att & DONT_ENUM) == 0); } diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc index 1ec3ab979..0e8a508af 100644 --- a/test/cctest/test-api.cc +++ b/test/cctest/test-api.cc @@ -1027,6 +1027,15 @@ THREADED_TEST(PrePropertyHandler) { } +THREADED_TEST(UndefinedIsNotEnumerable) { + v8::HandleScope scope; + LocalContext env; + v8::Handle result = Script::Compile(v8_str( + "this.propertyIsEnumerable(undefined)"))->Run(); + CHECK(result->IsFalse()); +} + + v8::Handle