<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[200411] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/200411">200411</a></dd>
<dt>Author</dt> <dd>youenn.fablet@crf.canon.fr</dd>
<dt>Date</dt> <dd>2016-05-04 01:22:18 -0700 (Wed, 04 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Rename JSKeyValueIterator as JSDOMIterator
https://bugs.webkit.org/show_bug.cgi?id=157308

Reviewed by Darin Adler.

No change of behavior.

* bindings/js/JSDOMIterator.h: Renamed from Source/WebCore/bindings/js/JSKeyValueIterator.h.
(WebCore::JSDOMIteratorPrototype::create):
(WebCore::JSDOMIteratorPrototype::createStructure):
(WebCore::JSDOMIteratorPrototype::JSDOMIteratorPrototype):
(WebCore::createKeyValueIterator):
(WebCore::keyValueIteratorForEach):
(WebCore::JSDOMIterator&lt;JSWrapper&gt;::destroy):
(WebCore::JSDOMIterator&lt;JSWrapper&gt;::next):
(WebCore::JSDOMIteratorPrototype&lt;JSWrapper&gt;::next):
(WebCore::JSDOMIteratorPrototype&lt;JSWrapper&gt;::finishCreation):
* bindings/js/JSFontFaceSetCustom.cpp:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementationIterableFunctions):
* bindings/scripts/test/JS/JSTestObj.cpp:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSFontFaceSetCustomcpp">trunk/Source/WebCore/bindings/js/JSFontFaceSetCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMIteratorh">trunk/Source/WebCore/bindings/js/JSDOMIterator.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorebindingsjsJSKeyValueIteratorh">trunk/Source/WebCore/bindings/js/JSKeyValueIterator.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200410 => 200411)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-04 07:44:40 UTC (rev 200410)
+++ trunk/Source/WebCore/ChangeLog        2016-05-04 08:22:18 UTC (rev 200411)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2016-05-04  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
+
+        Rename JSKeyValueIterator as JSDOMIterator
+        https://bugs.webkit.org/show_bug.cgi?id=157308
+
+        Reviewed by Darin Adler.
+
+        No change of behavior.
+
+        * bindings/js/JSDOMIterator.h: Renamed from Source/WebCore/bindings/js/JSKeyValueIterator.h.
+        (WebCore::JSDOMIteratorPrototype::create):
+        (WebCore::JSDOMIteratorPrototype::createStructure):
+        (WebCore::JSDOMIteratorPrototype::JSDOMIteratorPrototype):
+        (WebCore::createKeyValueIterator):
+        (WebCore::keyValueIteratorForEach):
+        (WebCore::JSDOMIterator&lt;JSWrapper&gt;::destroy):
+        (WebCore::JSDOMIterator&lt;JSWrapper&gt;::next):
+        (WebCore::JSDOMIteratorPrototype&lt;JSWrapper&gt;::next):
+        (WebCore::JSDOMIteratorPrototype&lt;JSWrapper&gt;::finishCreation):
+        * bindings/js/JSFontFaceSetCustom.cpp:
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateImplementationIterableFunctions):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+
</ins><span class="cx"> 2016-05-04  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         CrashTracer: [USER] com.apple.WebKit.WebContent at …ple.WebCore: WebCore::EditCommandComposition::unapply + 105
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMIteratorhfromrev200410trunkSourceWebCorebindingsjsJSKeyValueIteratorh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/bindings/js/JSDOMIterator.h (from rev 200410, trunk/Source/WebCore/bindings/js/JSKeyValueIterator.h) (0 => 200411)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMIterator.h                                (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSDOMIterator.h        2016-05-04 08:22:18 UTC (rev 200411)
</span><span class="lines">@@ -0,0 +1,188 @@
</span><ins>+/*
+ * Copyright (C) 2016 Canon, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY CANON INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL CANON INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef JSDOMIterator_h
+#define JSDOMIterator_h
+
+#include &quot;JSDOMBinding.h&quot;
+#include &lt;runtime/JSDestructibleObject.h&gt;
+#include &lt;type_traits&gt;
+
+namespace WebCore {
+
+template&lt;typename JSWrapper&gt;
+class JSDOMIteratorPrototype : public JSC::JSNonFinalObject {
+public:
+    using Base = JSC::JSNonFinalObject;
+    using DOMWrapped = typename JSWrapper::DOMWrapped;
+
+    static JSDOMIteratorPrototype* create(JSC::VM&amp; vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
+    {
+        JSDOMIteratorPrototype* prototype = new (NotNull, JSC::allocateCell&lt;JSDOMIteratorPrototype&gt;(vm.heap)) JSDOMIteratorPrototype(vm, structure);
+        prototype-&gt;finishCreation(vm, globalObject);
+        return prototype;
+    }
+
+    DECLARE_INFO;
+
+    static JSC::Structure* createStructure(JSC::VM&amp; vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+    static JSC::EncodedJSValue JSC_HOST_CALL next(JSC::ExecState*);
+
+private:
+    JSDOMIteratorPrototype(JSC::VM&amp; vm, JSC::Structure* structure) : Base(vm, structure) { }
+
+    void finishCreation(JSC::VM&amp;, JSC::JSGlobalObject*);
+};
+
+enum class IterationKind { Key, Value, KeyValue };
+
+template&lt;typename JSWrapper&gt;
+class JSDOMIterator: public JSDOMObject {
+public:
+    using DOMWrapped = typename std::remove_reference&lt;decltype(std::declval&lt;JSWrapper&gt;().wrapped())&gt;::type;
+    using Base = JSDOMObject;
+
+    DECLARE_INFO;
+
+    static JSC::Structure* createStructure(JSC::VM&amp; vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+    static JSDOMIterator* create(JSC::VM&amp; vm, JSC::Structure* structure, JSWrapper&amp; iteratedObject, IterationKind kind)
+    {
+        JSDOMIterator* instance = new (NotNull, JSC::allocateCell&lt;JSDOMIterator&gt;(vm.heap)) JSDOMIterator(structure, iteratedObject, kind);
+        instance-&gt;finishCreation(vm);
+        return instance;
+    }
+
+    static JSDOMIteratorPrototype&lt;JSWrapper&gt;* createPrototype(JSC::VM&amp; vm, JSC::JSGlobalObject* globalObject)
+    {
+        return JSDOMIteratorPrototype&lt;JSWrapper&gt;::create(vm, globalObject,
+            JSDOMIteratorPrototype&lt;JSWrapper&gt;::createStructure(vm, globalObject, globalObject-&gt;objectPrototype()));
+    }
+
+    JSC::JSValue next(JSC::ExecState&amp;);
+
+private:
+    JSDOMIterator(JSC::Structure* structure, JSWrapper&amp; iteratedObject, IterationKind kind)
+        : Base(structure, *iteratedObject.globalObject())
+        , m_iterator(iteratedObject.wrapped().createIterator())
+        , m_kind(kind)
+    {
+    }
+
+    static void destroy(JSC::JSCell*);
+
+    typename DOMWrapped::Iterator m_iterator;
+    IterationKind m_kind;
+};
+
+template&lt;typename JSWrapper&gt;
+JSC::EncodedJSValue createKeyValueIterator(JSC::ExecState&amp; state, IterationKind kind, const char* propertyName)
+{
+    auto wrapper = JSC::jsDynamicCast&lt;JSWrapper*&gt;(state.thisValue());
+    if (UNLIKELY(!wrapper))
+        return throwThisTypeError(state, JSWrapper::info()-&gt;className, propertyName);
+    JSDOMGlobalObject&amp; globalObject = *wrapper-&gt;globalObject();
+    return JSC::JSValue::encode(JSDOMIterator&lt;JSWrapper&gt;::create(globalObject.vm(), getDOMStructure&lt;JSDOMIterator&lt;JSWrapper&gt;&gt;(globalObject.vm(), globalObject), *wrapper, kind));
+}
+
+template&lt;typename JSWrapper&gt;
+JSC::EncodedJSValue keyValueIteratorForEach(JSC::ExecState&amp; state, const char* propertyName)
+{
+    auto wrapper = JSC::jsDynamicCast&lt;JSWrapper*&gt;(state.thisValue());
+    if (UNLIKELY(!wrapper))
+        return throwThisTypeError(state, JSWrapper::info()-&gt;className, propertyName);
+
+    JSC::CallData callData;
+    JSC::CallType callType = JSC::getCallData(state.argument(0), callData);
+    if (callType == JSC::CallType::None)
+        return throwVMTypeError(&amp;state);
+
+    auto iterator = wrapper-&gt;wrapped().createIterator();
+    while (auto value = iterator.next(state)) {
+        JSC::MarkedArgumentBuffer arguments;
+        arguments.append(toJS(&amp;state, wrapper-&gt;globalObject(), value.value().value));
+        arguments.append(toJS(&amp;state, wrapper-&gt;globalObject(), value.value().key));
+        arguments.append(wrapper);
+        JSC::call(&amp;state, state.argument(0), callType, callData, wrapper, arguments);
+        if (state.hadException())
+            break;
+    } 
+    return JSC::JSValue::encode(JSC::jsUndefined());
+}
+
+template&lt;typename JSWrapper&gt;
+void JSDOMIterator&lt;JSWrapper&gt;::destroy(JSCell* cell)
+{
+    JSDOMIterator&lt;JSWrapper&gt;* thisObject = JSC::jsCast&lt;JSDOMIterator&lt;JSWrapper&gt;*&gt;(cell);
+    thisObject-&gt;JSDOMIterator&lt;JSWrapper&gt;::~JSDOMIterator();
+}
+
+template&lt;typename JSWrapper&gt;
+JSC::JSValue JSDOMIterator&lt;JSWrapper&gt;::next(JSC::ExecState&amp; state)
+{
+    auto iteratorValue = m_iterator.next(state);
+    if (!iteratorValue)
+        return createIteratorResultObject(&amp;state, JSC::jsUndefined(), true);
+
+    JSC::JSValue value;
+    if (m_kind == IterationKind::Value)
+        value = toJS(&amp;state, globalObject(), iteratorValue.value().value);
+    else if (m_kind == IterationKind::Key)
+        value = toJS(&amp;state, globalObject(), iteratorValue.value().key);
+    else
+        value = jsPair(state, globalObject(), iteratorValue.value().key, iteratorValue.value().value);
+
+    return createIteratorResultObject(&amp;state, value, false);
+}
+
+template&lt;typename JSWrapper&gt;
+JSC::EncodedJSValue JSC_HOST_CALL JSDOMIteratorPrototype&lt;JSWrapper&gt;::next(JSC::ExecState* state)
+{
+    auto iterator = JSC::jsDynamicCast&lt;JSDOMIterator&lt;JSWrapper&gt;*&gt;(state-&gt;thisValue());
+    if (!iterator)
+        return JSC::JSValue::encode(throwTypeError(state, ASCIILiteral(&quot;Cannot call next() on a non-Iterator object&quot;)));
+
+    return JSC::JSValue::encode(iterator-&gt;next(*state));
+}
+
+template&lt;typename JSWrapper&gt;
+void JSDOMIteratorPrototype&lt;JSWrapper&gt;::finishCreation(JSC::VM&amp; vm, JSC::JSGlobalObject* globalObject)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(info()));
+
+    JSC_NATIVE_INTRINSIC_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames-&gt;next, next, JSC::DontEnum, 0, JSC::NoIntrinsic);
+}
+
+}
+
+#endif // !defined(JSDOMIterator_h)
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSFontFaceSetCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSFontFaceSetCustom.cpp (200410 => 200411)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSFontFaceSetCustom.cpp        2016-05-04 07:44:40 UTC (rev 200410)
+++ trunk/Source/WebCore/bindings/js/JSFontFaceSetCustom.cpp        2016-05-04 08:22:18 UTC (rev 200411)
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;FontFace.h&quot;
</span><span class="cx"> #include &quot;JSFontFace.h&quot;
</span><del>-#include &quot;JSKeyValueIterator.h&quot;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSKeyValueIteratorh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/bindings/js/JSKeyValueIterator.h (200410 => 200411)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSKeyValueIterator.h        2016-05-04 07:44:40 UTC (rev 200410)
+++ trunk/Source/WebCore/bindings/js/JSKeyValueIterator.h        2016-05-04 08:22:18 UTC (rev 200411)
</span><span class="lines">@@ -1,188 +0,0 @@
</span><del>-/*
- * Copyright (C) 2016 Canon, Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY CANON INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL CANON INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef JSKeyValueIterator_h
-#define JSKeyValueIterator_h
-
-#include &quot;JSDOMBinding.h&quot;
-#include &lt;runtime/JSDestructibleObject.h&gt;
-#include &lt;type_traits&gt;
-
-namespace WebCore {
-
-template&lt;typename JSWrapper&gt;
-class JSKeyValueIteratorPrototype : public JSC::JSNonFinalObject {
-public:
-    using Base = JSC::JSNonFinalObject;
-    using DOMWrapped = typename JSWrapper::DOMWrapped;
-
-    static JSKeyValueIteratorPrototype* create(JSC::VM&amp; vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
-    {
-        JSKeyValueIteratorPrototype* prototype = new (NotNull, JSC::allocateCell&lt;JSKeyValueIteratorPrototype&gt;(vm.heap)) JSKeyValueIteratorPrototype(vm, structure);
-        prototype-&gt;finishCreation(vm, globalObject);
-        return prototype;
-    }
-
-    DECLARE_INFO;
-
-    static JSC::Structure* createStructure(JSC::VM&amp; vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
-    {
-        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
-    }
-
-    static JSC::EncodedJSValue JSC_HOST_CALL next(JSC::ExecState*);
-
-private:
-    JSKeyValueIteratorPrototype(JSC::VM&amp; vm, JSC::Structure* structure) : Base(vm, structure) { }
-
-    void finishCreation(JSC::VM&amp;, JSC::JSGlobalObject*);
-};
-
-enum class IterationKind { Key, Value, KeyValue };
-
-template&lt;typename JSWrapper&gt;
-class JSKeyValueIterator: public JSDOMObject {
-public:
-    using DOMWrapped = typename std::remove_reference&lt;decltype(std::declval&lt;JSWrapper&gt;().wrapped())&gt;::type;
-    using Base = JSDOMObject;
-
-    DECLARE_INFO;
-
-    static JSC::Structure* createStructure(JSC::VM&amp; vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
-    {
-        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
-    }
-
-    static JSKeyValueIterator* create(JSC::VM&amp; vm, JSC::Structure* structure, JSWrapper&amp; iteratedObject, IterationKind kind)
-    {
-        JSKeyValueIterator* instance = new (NotNull, JSC::allocateCell&lt;JSKeyValueIterator&gt;(vm.heap)) JSKeyValueIterator(structure, iteratedObject, kind);
-        instance-&gt;finishCreation(vm);
-        return instance;
-    }
-
-    static JSKeyValueIteratorPrototype&lt;JSWrapper&gt;* createPrototype(JSC::VM&amp; vm, JSC::JSGlobalObject* globalObject)
-    {
-        return JSKeyValueIteratorPrototype&lt;JSWrapper&gt;::create(vm, globalObject,
-            JSKeyValueIteratorPrototype&lt;JSWrapper&gt;::createStructure(vm, globalObject, globalObject-&gt;objectPrototype()));
-    }
-
-    JSC::JSValue next(JSC::ExecState&amp;);
-
-private:
-    JSKeyValueIterator(JSC::Structure* structure, JSWrapper&amp; iteratedObject, IterationKind kind)
-        : Base(structure, *iteratedObject.globalObject())
-        , m_iterator(iteratedObject.wrapped().createIterator())
-        , m_kind(kind)
-    {
-    }
-
-    static void destroy(JSC::JSCell*);
-
-    typename DOMWrapped::Iterator m_iterator;
-    IterationKind m_kind;
-};
-
-template&lt;typename JSWrapper&gt;
-JSC::EncodedJSValue createKeyValueIterator(JSC::ExecState&amp; state, IterationKind kind, const char* propertyName)
-{
-    auto wrapper = JSC::jsDynamicCast&lt;JSWrapper*&gt;(state.thisValue());
-    if (UNLIKELY(!wrapper))
-        return throwThisTypeError(state, JSWrapper::info()-&gt;className, propertyName);
-    JSDOMGlobalObject&amp; globalObject = *wrapper-&gt;globalObject();
-    return JSC::JSValue::encode(JSKeyValueIterator&lt;JSWrapper&gt;::create(globalObject.vm(), getDOMStructure&lt;JSKeyValueIterator&lt;JSWrapper&gt;&gt;(globalObject.vm(), globalObject), *wrapper, kind));
-}
-
-template&lt;typename JSWrapper&gt;
-JSC::EncodedJSValue keyValueIteratorForEach(JSC::ExecState&amp; state, const char* propertyName)
-{
-    auto wrapper = JSC::jsDynamicCast&lt;JSWrapper*&gt;(state.thisValue());
-    if (UNLIKELY(!wrapper))
-        return throwThisTypeError(state, JSWrapper::info()-&gt;className, propertyName);
-
-    JSC::CallData callData;
-    JSC::CallType callType = JSC::getCallData(state.argument(0), callData);
-    if (callType == JSC::CallType::None)
-        return throwVMTypeError(&amp;state);
-
-    auto iterator = wrapper-&gt;wrapped().createIterator();
-    while (auto value = iterator.next(state)) {
-        JSC::MarkedArgumentBuffer arguments;
-        arguments.append(toJS(&amp;state, wrapper-&gt;globalObject(), value.value().value));
-        arguments.append(toJS(&amp;state, wrapper-&gt;globalObject(), value.value().key));
-        arguments.append(wrapper);
-        JSC::call(&amp;state, state.argument(0), callType, callData, wrapper, arguments);
-        if (state.hadException())
-            break;
-    } 
-    return JSC::JSValue::encode(JSC::jsUndefined());
-}
-
-template&lt;typename JSWrapper&gt;
-void JSKeyValueIterator&lt;JSWrapper&gt;::destroy(JSCell* cell)
-{
-    JSKeyValueIterator&lt;JSWrapper&gt;* thisObject = JSC::jsCast&lt;JSKeyValueIterator&lt;JSWrapper&gt;*&gt;(cell);
-    thisObject-&gt;JSKeyValueIterator&lt;JSWrapper&gt;::~JSKeyValueIterator();
-}
-
-template&lt;typename JSWrapper&gt;
-JSC::JSValue JSKeyValueIterator&lt;JSWrapper&gt;::next(JSC::ExecState&amp; state)
-{
-    auto iteratorValue = m_iterator.next(state);
-    if (!iteratorValue)
-        return createIteratorResultObject(&amp;state, JSC::jsUndefined(), true);
-
-    JSC::JSValue value;
-    if (m_kind == IterationKind::Value)
-        value = toJS(&amp;state, globalObject(), iteratorValue.value().value);
-    else if (m_kind == IterationKind::Key)
-        value = toJS(&amp;state, globalObject(), iteratorValue.value().key);
-    else
-        value = jsPair(state, globalObject(), iteratorValue.value().key, iteratorValue.value().value);
-
-    return createIteratorResultObject(&amp;state, value, false);
-}
-
-template&lt;typename JSWrapper&gt;
-JSC::EncodedJSValue JSC_HOST_CALL JSKeyValueIteratorPrototype&lt;JSWrapper&gt;::next(JSC::ExecState* state)
-{
-    auto iterator = JSC::jsDynamicCast&lt;JSKeyValueIterator&lt;JSWrapper&gt;*&gt;(state-&gt;thisValue());
-    if (!iterator)
-        return JSC::JSValue::encode(throwTypeError(state, ASCIILiteral(&quot;Cannot call next() on a non-Iterator object&quot;)));
-
-    return JSC::JSValue::encode(iterator-&gt;next(*state));
-}
-
-template&lt;typename JSWrapper&gt;
-void JSKeyValueIteratorPrototype&lt;JSWrapper&gt;::finishCreation(JSC::VM&amp; vm, JSC::JSGlobalObject* globalObject)
-{
-    Base::finishCreation(vm);
-    ASSERT(inherits(info()));
-
-    JSC_NATIVE_INTRINSIC_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames-&gt;next, next, JSC::DontEnum, 0, JSC::NoIntrinsic);
-}
-
-}
-
-#endif // !defined(JSKeyValueIterator_h)
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (200410 => 200411)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-05-04 07:44:40 UTC (rev 200410)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-05-04 08:22:18 UTC (rev 200411)
</span><span class="lines">@@ -4157,11 +4157,11 @@
</span><span class="cx">     my $className = &quot;JS$interfaceName&quot;;
</span><span class="cx">     my $visibleInterfaceName = $codeGenerator-&gt;GetVisibleInterfaceName($interface);
</span><span class="cx"> 
</span><del>-    AddToImplIncludes(&quot;JSKeyValueIterator.h&quot;);
</del><ins>+    AddToImplIncludes(&quot;JSDOMIterator.h&quot;);
</ins><span class="cx"> 
</span><span class="cx">     push(@implContent,  &lt;&lt;END);
</span><del>-using ${interfaceName}Iterator = JSKeyValueIterator&lt;${className}&gt;;
-using ${interfaceName}IteratorPrototype = JSKeyValueIteratorPrototype&lt;${className}&gt;;
</del><ins>+using ${interfaceName}Iterator = JSDOMIterator&lt;${className}&gt;;
+using ${interfaceName}IteratorPrototype = JSDOMIteratorPrototype&lt;${className}&gt;;
</ins><span class="cx"> 
</span><span class="cx"> template&lt;&gt;
</span><span class="cx"> const JSC::ClassInfo ${interfaceName}Iterator::s_info = { &quot;${visibleInterfaceName} Iterator&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(${interfaceName}Iterator) };
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (200410 => 200411)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-05-04 07:44:40 UTC (rev 200410)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-05-04 08:22:18 UTC (rev 200411)
</span><span class="lines">@@ -30,12 +30,12 @@
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;JSDOMBinding.h&quot;
</span><span class="cx"> #include &quot;JSDOMConstructor.h&quot;
</span><ins>+#include &quot;JSDOMIterator.h&quot;
</ins><span class="cx"> #include &quot;JSDOMPromise.h&quot;
</span><span class="cx"> #include &quot;JSDOMStringList.h&quot;
</span><span class="cx"> #include &quot;JSDocument.h&quot;
</span><span class="cx"> #include &quot;JSEventListener.h&quot;
</span><span class="cx"> #include &quot;JSFetchRequest.h&quot;
</span><del>-#include &quot;JSKeyValueIterator.h&quot;
</del><span class="cx"> #include &quot;JSNode.h&quot;
</span><span class="cx"> #include &quot;JSSVGDocument.h&quot;
</span><span class="cx"> #include &quot;JSSVGPoint.h&quot;
</span><span class="lines">@@ -5890,8 +5890,8 @@
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-using TestObjIterator = JSKeyValueIterator&lt;JSTestObj&gt;;
-using TestObjIteratorPrototype = JSKeyValueIteratorPrototype&lt;JSTestObj&gt;;
</del><ins>+using TestObjIterator = JSDOMIterator&lt;JSTestObj&gt;;
+using TestObjIteratorPrototype = JSDOMIteratorPrototype&lt;JSTestObj&gt;;
</ins><span class="cx"> 
</span><span class="cx"> template&lt;&gt;
</span><span class="cx"> const JSC::ClassInfo TestObjIterator::s_info = { &quot;TestObject Iterator&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(TestObjIterator) };
</span></span></pre>
</div>
</div>

</body>
</html>