[ES6] Implement Reflect.enumerate
[WebKit-https.git] / Source / JavaScriptCore / ChangeLog
index 60d82b5..1fc478b 100644 (file)
@@ -1,5 +1,43 @@
 2015-07-27  Yusuke Suzuki  <utatane.tea@gmail.com>
 
+        [ES6] Implement Reflect.enumerate
+        https://bugs.webkit.org/show_bug.cgi?id=147347
+
+        Reviewed by Sam Weinig.
+
+        This patch implements Reflect.enumerate.
+        It returns the iterator that iterates the enumerable keys of the given object.
+        It follows the for-in's enumeration order.
+
+        To implement it, we write down the same logic to the for-in's enumeration code in C++.
+
+        * CMakeLists.txt:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::init):
+        (JSC::JSGlobalObject::visitChildren):
+        * runtime/JSGlobalObject.h:
+        (JSC::JSGlobalObject::propertyNameIteratorStructure):
+        * runtime/JSPropertyNameIterator.cpp: Added.
+        (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
+        (JSC::JSPropertyNameIterator::clone):
+        (JSC::JSPropertyNameIterator::create):
+        (JSC::JSPropertyNameIterator::finishCreation):
+        (JSC::JSPropertyNameIterator::visitChildren):
+        (JSC::JSPropertyNameIterator::next):
+        (JSC::propertyNameIteratorFuncNext):
+        * runtime/JSPropertyNameIterator.h: Added.
+        (JSC::JSPropertyNameIterator::createStructure):
+        * runtime/ReflectObject.cpp:
+        (JSC::reflectObjectEnumerate):
+        * tests/stress/reflect-enumerate.js: Added.
+        (shouldBe):
+        (shouldThrow):
+
+2015-07-27  Yusuke Suzuki  <utatane.tea@gmail.com>
+
         [ES6] Implement Reflect.preventExtensions
         https://bugs.webkit.org/show_bug.cgi?id=147331