Reviewers: Mads Ager, Description: Fixing propertyIsEnumerable for properties that are *both* enumerable and read-only.
Please review this at http://codereview.chromium.org/8962 SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M src/runtime.cc M test/cctest/test-api.cc Index: test/cctest/test-api.cc =================================================================== --- test/cctest/test-api.cc (revision 665) +++ test/cctest/test-api.cc (working copy) @@ -1027,6 +1027,15 @@ } +THREADED_TEST(UndefinedIsNotEnumerable) { + v8::HandleScope scope; + LocalContext env; + v8::Handle<Value> result = Script::Compile(v8_str( + "this.propertyIsEnumerable(undefined)"))->Run(); + CHECK(result->IsFalse()); +} + + v8::Handle<Script> call_recursively_script; static const int kTargetRecursionDepth = 300; // near maximum Index: src/runtime.cc =================================================================== --- src/runtime.cc (revision 665) +++ src/runtime.cc (working copy) @@ -1934,7 +1934,7 @@ } PropertyAttributes att = object->GetLocalPropertyAttribute(key); - return Heap::ToBoolean(att != ABSENT && att != DONT_ENUM); + return Heap::ToBoolean(att != ABSENT && (att & DONT_ENUM) == 0); } --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
