Author: olehougaard
Date: Fri Oct 31 04:53:29 2008
New Revision: 670
Modified:
branches/bleeding_edge/src/runtime.cc
branches/bleeding_edge/test/cctest/test-api.cc
Log:
Fixing propertyIsEnumerable for properties that are *both* enumerable and
read-only.
Review URL: http://codereview.chromium.org/8962
Modified: branches/bleeding_edge/src/runtime.cc
==============================================================================
--- branches/bleeding_edge/src/runtime.cc (original)
+++ branches/bleeding_edge/src/runtime.cc Fri Oct 31 04:53:29 2008
@@ -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);
}
Modified: branches/bleeding_edge/test/cctest/test-api.cc
==============================================================================
--- branches/bleeding_edge/test/cctest/test-api.cc (original)
+++ branches/bleeding_edge/test/cctest/test-api.cc Fri Oct 31 04:53:29 2008
@@ -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
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---