<!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>[181203] trunk</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/181203">181203</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-03-06 20:02:53 -0800 (Fri, 06 Mar 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: ES6: Improved Support for Iterator Objects
https://bugs.webkit.org/show_bug.cgi?id=142420
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-06
Reviewed by Timothy Hatcher.
Source/JavaScriptCore:
* inspector/protocol/Runtime.json:
Add new object subtype "iterator" for built-in iterator objects.
* inspector/InjectedScriptSource.js:
Return iterator values as Entry objects.
* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::subtype):
Identify "iterator" typed objects.
(Inspector::JSInjectedScriptHost::getInternalProperties):
Provide internal properties for the different Iterator objects.
(Inspector::JSInjectedScriptHost::iteratorEntries):
Fetch the next few iterator entries of a built-in iterator object.
* inspector/JSInjectedScriptHost.h:
* inspector/JSInjectedScriptHostPrototype.cpp:
(Inspector::JSInjectedScriptHostPrototype::finishCreation):
(Inspector::jsInjectedScriptHostPrototypeFunctionIteratorEntries):
Call through to JSInjectedScriptHost.
* runtime/JSArgumentsIterator.cpp:
(JSC::JSArgumentsIterator::clone):
* runtime/JSArgumentsIterator.h:
(JSC::JSArgumentsIterator::iteratedValue):
* runtime/JSArrayIterator.cpp:
(JSC::JSArrayIterator::kind):
(JSC::JSArrayIterator::iteratedValue):
(JSC::JSArrayIterator::clone):
* runtime/JSArrayIterator.h:
* runtime/JSMapIterator.cpp:
(JSC::JSMapIterator::finishCreation):
(JSC::JSMapIterator::clone):
* runtime/JSMapIterator.h:
(JSC::JSMapIterator::kind):
(JSC::JSMapIterator::iteratedValue):
* runtime/JSSetIterator.cpp:
(JSC::JSSetIterator::finishCreation):
(JSC::JSSetIterator::clone):
* runtime/JSSetIterator.h:
(JSC::JSSetIterator::kind):
(JSC::JSSetIterator::iteratedValue):
* runtime/JSStringIterator.cpp:
(JSC::JSStringIterator::iteratedValue):
(JSC::JSStringIterator::clone):
* runtime/JSStringIterator.h:
Add accessors for internal properties and provide a way to clone the
iterator so we can be at the same index and peek at the next few
objects without modifying the original iterator object.
Source/WebInspectorUI:
* UserInterface/Views/ConsoleMessageImpl.js:
(WebInspector.ConsoleMessageImpl):
Treat an iterator like an object.
* UserInterface/Views/ObjectPreviewView.js:
Output iterator previews with []s, not {}s.
LayoutTests:
* inspector/model/remote-object.html:
Update tests to include iterator objects.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsinspectormodelremoteobjectexpectedtxt">trunk/LayoutTests/inspector/model/remote-object-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectormodelremoteobjecthtml">trunk/LayoutTests/inspector/model/remote-object.html</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorInjectedScriptSourcejs">trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSInjectedScriptHostcpp">trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSInjectedScriptHosth">trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSInjectedScriptHostPrototypecpp">trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorprotocolRuntimejson">trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSArgumentsIteratorcpp">trunk/Source/JavaScriptCore/runtime/JSArgumentsIterator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSArgumentsIteratorh">trunk/Source/JavaScriptCore/runtime/JSArgumentsIterator.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSArrayIteratorcpp">trunk/Source/JavaScriptCore/runtime/JSArrayIterator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSArrayIteratorh">trunk/Source/JavaScriptCore/runtime/JSArrayIterator.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSMapIteratorcpp">trunk/Source/JavaScriptCore/runtime/JSMapIterator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSMapIteratorh">trunk/Source/JavaScriptCore/runtime/JSMapIterator.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSSetIteratorcpp">trunk/Source/JavaScriptCore/runtime/JSSetIterator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSSetIteratorh">trunk/Source/JavaScriptCore/runtime/JSSetIterator.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSStringIteratorcpp">trunk/Source/JavaScriptCore/runtime/JSStringIterator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSStringIteratorh">trunk/Source/JavaScriptCore/runtime/JSStringIterator.h</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsConsoleMessageImpljs">trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageImpl.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsObjectPreviewViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (181202 => 181203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-03-07 03:47:52 UTC (rev 181202)
+++ trunk/LayoutTests/ChangeLog        2015-03-07 04:02:53 UTC (rev 181203)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2015-03-06 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: ES6: Improved Support for Iterator Objects
+ https://bugs.webkit.org/show_bug.cgi?id=142420
+
+ Reviewed by Timothy Hatcher.
+
+ * inspector/model/remote-object.html:
+ Update tests to include iterator objects.
+
</ins><span class="cx"> 2015-03-06 Brent Fulgham <bfulgham@apple.com>
</span><span class="cx">
</span><span class="cx"> [Win] Mark svg/fonts/svg-font-horiz-orig.html as Image-only failing.
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelremoteobjectexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/model/remote-object-expected.txt (181202 => 181203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/remote-object-expected.txt        2015-03-07 03:47:52 UTC (rev 181202)
+++ trunk/LayoutTests/inspector/model/remote-object-expected.txt        2015-03-07 04:02:53 UTC (rev 181203)
</span><span class="lines">@@ -2776,6 +2776,901 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> -----------------------------------------------------
</span><ins>+EXPRESSION: 'a'[Symbol.iterator]()
+{
+ "_type": "object",
+ "_subtype": "iterator",
+ "_objectId": "<filtered>",
+ "_description": "StringIterator",
+ "_preview": {
+ "_type": "object",
+ "_subtype": "iterator",
+ "_description": "StringIterator",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": [
+ {
+ "_name": "string",
+ "_type": "string",
+ "_value": "a",
+ "_internal": true
+ }
+ ],
+ "_entries": [
+ {
+ "_value": {
+ "_type": "string",
+ "_description": "a",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ }
+ ]
+ }
+}
+
+-----------------------------------------------------
+EXPRESSION: 'long string'[Symbol.iterator]()
+{
+ "_type": "object",
+ "_subtype": "iterator",
+ "_objectId": "<filtered>",
+ "_description": "StringIterator",
+ "_preview": {
+ "_type": "object",
+ "_subtype": "iterator",
+ "_description": "StringIterator",
+ "_lossless": false,
+ "_overflow": true,
+ "_properties": [
+ {
+ "_name": "string",
+ "_type": "string",
+ "_value": "long string",
+ "_internal": true
+ }
+ ],
+ "_entries": [
+ {
+ "_value": {
+ "_type": "string",
+ "_description": "l",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "string",
+ "_description": "o",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "string",
+ "_description": "n",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "string",
+ "_description": "g",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "string",
+ "_description": " ",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ }
+ ]
+ }
+}
+
+-----------------------------------------------------
+EXPRESSION: [][Symbol.iterator]()
+{
+ "_type": "object",
+ "_subtype": "iterator",
+ "_objectId": "<filtered>",
+ "_description": "ArrayIterator",
+ "_preview": {
+ "_type": "object",
+ "_subtype": "iterator",
+ "_description": "ArrayIterator",
+ "_lossless": false,
+ "_overflow": false,
+ "_properties": [
+ {
+ "_name": "array",
+ "_type": "object",
+ "_subtype": "array",
+ "_value": "Array",
+ "_internal": true
+ },
+ {
+ "_name": "kind",
+ "_type": "string",
+ "_value": "value",
+ "_internal": true
+ }
+ ],
+ "_entries": []
+ }
+}
+
+-----------------------------------------------------
+EXPRESSION: [1][Symbol.iterator]()
+{
+ "_type": "object",
+ "_subtype": "iterator",
+ "_objectId": "<filtered>",
+ "_description": "ArrayIterator",
+ "_preview": {
+ "_type": "object",
+ "_subtype": "iterator",
+ "_description": "ArrayIterator",
+ "_lossless": false,
+ "_overflow": false,
+ "_properties": [
+ {
+ "_name": "array",
+ "_type": "object",
+ "_subtype": "array",
+ "_value": "Array",
+ "_internal": true
+ },
+ {
+ "_name": "kind",
+ "_type": "string",
+ "_value": "value",
+ "_internal": true
+ }
+ ],
+ "_entries": [
+ {
+ "_value": {
+ "_type": "number",
+ "_description": "1",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ }
+ ]
+ }
+}
+
+-----------------------------------------------------
+EXPRESSION: [1, 'two', 3, 'four', 5, 'size'][Symbol.iterator]()
+{
+ "_type": "object",
+ "_subtype": "iterator",
+ "_objectId": "<filtered>",
+ "_description": "ArrayIterator",
+ "_preview": {
+ "_type": "object",
+ "_subtype": "iterator",
+ "_description": "ArrayIterator",
+ "_lossless": false,
+ "_overflow": true,
+ "_properties": [
+ {
+ "_name": "array",
+ "_type": "object",
+ "_subtype": "array",
+ "_value": "Array",
+ "_internal": true
+ },
+ {
+ "_name": "kind",
+ "_type": "string",
+ "_value": "value",
+ "_internal": true
+ }
+ ],
+ "_entries": [
+ {
+ "_value": {
+ "_type": "number",
+ "_description": "1",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "string",
+ "_description": "two",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "number",
+ "_description": "3",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "string",
+ "_description": "four",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "number",
+ "_description": "5",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ }
+ ]
+ }
+}
+
+-----------------------------------------------------
+EXPRESSION: [1, 'two', 3, 'four', 5, 'size'].keys()
+{
+ "_type": "object",
+ "_subtype": "iterator",
+ "_objectId": "<filtered>",
+ "_description": "ArrayIterator",
+ "_preview": {
+ "_type": "object",
+ "_subtype": "iterator",
+ "_description": "ArrayIterator",
+ "_lossless": false,
+ "_overflow": true,
+ "_properties": [
+ {
+ "_name": "array",
+ "_type": "object",
+ "_subtype": "array",
+ "_value": "Array",
+ "_internal": true
+ },
+ {
+ "_name": "kind",
+ "_type": "string",
+ "_value": "key",
+ "_internal": true
+ }
+ ],
+ "_entries": [
+ {
+ "_value": {
+ "_type": "number",
+ "_description": "0",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "number",
+ "_description": "1",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "number",
+ "_description": "2",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "number",
+ "_description": "3",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "number",
+ "_description": "4",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ }
+ ]
+ }
+}
+
+-----------------------------------------------------
+EXPRESSION: [1, 'two', 3, 'four', 5, 'size'].entries()
+{
+ "_type": "object",
+ "_subtype": "iterator",
+ "_objectId": "<filtered>",
+ "_description": "ArrayIterator",
+ "_preview": {
+ "_type": "object",
+ "_subtype": "iterator",
+ "_description": "ArrayIterator",
+ "_lossless": false,
+ "_overflow": true,
+ "_properties": [
+ {
+ "_name": "array",
+ "_type": "object",
+ "_subtype": "array",
+ "_value": "Array",
+ "_internal": true
+ },
+ {
+ "_name": "kind",
+ "_type": "string",
+ "_value": "key+value",
+ "_internal": true
+ }
+ ],
+ "_entries": [
+ {
+ "_value": {
+ "_type": "object",
+ "_subtype": "array",
+ "_description": "Array",
+ "_lossless": true,
+ "_overflow": false,
+ "_size": 2,
+ "_properties": [
+ {
+ "_name": "0",
+ "_type": "number",
+ "_value": "0"
+ },
+ {
+ "_name": "1",
+ "_type": "number",
+ "_value": "1"
+ }
+ ],
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "object",
+ "_subtype": "array",
+ "_description": "Array",
+ "_lossless": true,
+ "_overflow": false,
+ "_size": 2,
+ "_properties": [
+ {
+ "_name": "0",
+ "_type": "number",
+ "_value": "1"
+ },
+ {
+ "_name": "1",
+ "_type": "string",
+ "_value": "two"
+ }
+ ],
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "object",
+ "_subtype": "array",
+ "_description": "Array",
+ "_lossless": true,
+ "_overflow": false,
+ "_size": 2,
+ "_properties": [
+ {
+ "_name": "0",
+ "_type": "number",
+ "_value": "2"
+ },
+ {
+ "_name": "1",
+ "_type": "number",
+ "_value": "3"
+ }
+ ],
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "object",
+ "_subtype": "array",
+ "_description": "Array",
+ "_lossless": true,
+ "_overflow": false,
+ "_size": 2,
+ "_properties": [
+ {
+ "_name": "0",
+ "_type": "number",
+ "_value": "3"
+ },
+ {
+ "_name": "1",
+ "_type": "string",
+ "_value": "four"
+ }
+ ],
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "object",
+ "_subtype": "array",
+ "_description": "Array",
+ "_lossless": true,
+ "_overflow": false,
+ "_size": 2,
+ "_properties": [
+ {
+ "_name": "0",
+ "_type": "number",
+ "_value": "4"
+ },
+ {
+ "_name": "1",
+ "_type": "number",
+ "_value": "5"
+ }
+ ],
+ "_entries": null
+ }
+ }
+ ]
+ }
+}
+
+-----------------------------------------------------
+EXPRESSION: map = new Map; map.set(1, 2); map.set('key', 'value'); map.values()
+{
+ "_type": "object",
+ "_subtype": "iterator",
+ "_objectId": "<filtered>",
+ "_description": "Map Iterator",
+ "_preview": {
+ "_type": "object",
+ "_subtype": "iterator",
+ "_description": "Map Iterator",
+ "_lossless": false,
+ "_overflow": false,
+ "_properties": [
+ {
+ "_name": "map",
+ "_type": "object",
+ "_subtype": "map",
+ "_value": "Map",
+ "_internal": true
+ },
+ {
+ "_name": "kind",
+ "_type": "string",
+ "_value": "value",
+ "_internal": true
+ }
+ ],
+ "_entries": [
+ {
+ "_value": {
+ "_type": "number",
+ "_description": "2",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "string",
+ "_description": "value",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ }
+ ]
+ }
+}
+
+-----------------------------------------------------
+EXPRESSION: map.keys()
+{
+ "_type": "object",
+ "_subtype": "iterator",
+ "_objectId": "<filtered>",
+ "_description": "Map Iterator",
+ "_preview": {
+ "_type": "object",
+ "_subtype": "iterator",
+ "_description": "Map Iterator",
+ "_lossless": false,
+ "_overflow": false,
+ "_properties": [
+ {
+ "_name": "map",
+ "_type": "object",
+ "_subtype": "map",
+ "_value": "Map",
+ "_internal": true
+ },
+ {
+ "_name": "kind",
+ "_type": "string",
+ "_value": "key",
+ "_internal": true
+ }
+ ],
+ "_entries": [
+ {
+ "_value": {
+ "_type": "number",
+ "_description": "1",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "string",
+ "_description": "key",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ }
+ ]
+ }
+}
+
+-----------------------------------------------------
+EXPRESSION: map.entries()
+{
+ "_type": "object",
+ "_subtype": "iterator",
+ "_objectId": "<filtered>",
+ "_description": "Map Iterator",
+ "_preview": {
+ "_type": "object",
+ "_subtype": "iterator",
+ "_description": "Map Iterator",
+ "_lossless": false,
+ "_overflow": false,
+ "_properties": [
+ {
+ "_name": "map",
+ "_type": "object",
+ "_subtype": "map",
+ "_value": "Map",
+ "_internal": true
+ },
+ {
+ "_name": "kind",
+ "_type": "string",
+ "_value": "key+value",
+ "_internal": true
+ }
+ ],
+ "_entries": [
+ {
+ "_value": {
+ "_type": "object",
+ "_subtype": "array",
+ "_description": "Array",
+ "_lossless": true,
+ "_overflow": false,
+ "_size": 2,
+ "_properties": [
+ {
+ "_name": "0",
+ "_type": "number",
+ "_value": "1"
+ },
+ {
+ "_name": "1",
+ "_type": "number",
+ "_value": "2"
+ }
+ ],
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "object",
+ "_subtype": "array",
+ "_description": "Array",
+ "_lossless": true,
+ "_overflow": false,
+ "_size": 2,
+ "_properties": [
+ {
+ "_name": "0",
+ "_type": "string",
+ "_value": "key"
+ },
+ {
+ "_name": "1",
+ "_type": "string",
+ "_value": "value"
+ }
+ ],
+ "_entries": null
+ }
+ }
+ ]
+ }
+}
+
+-----------------------------------------------------
+EXPRESSION: set = new Set; for (var i = 0; i <= 100; i++) set.add(i); set.values()
+{
+ "_type": "object",
+ "_subtype": "iterator",
+ "_objectId": "<filtered>",
+ "_description": "Set Iterator",
+ "_preview": {
+ "_type": "object",
+ "_subtype": "iterator",
+ "_description": "Set Iterator",
+ "_lossless": false,
+ "_overflow": true,
+ "_properties": [
+ {
+ "_name": "set",
+ "_type": "object",
+ "_subtype": "set",
+ "_value": "Set",
+ "_internal": true
+ },
+ {
+ "_name": "kind",
+ "_type": "string",
+ "_value": "value",
+ "_internal": true
+ }
+ ],
+ "_entries": [
+ {
+ "_value": {
+ "_type": "number",
+ "_description": "0",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "number",
+ "_description": "1",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "number",
+ "_description": "2",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "number",
+ "_description": "3",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "number",
+ "_description": "4",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ }
+ ]
+ }
+}
+
+-----------------------------------------------------
+EXPRESSION: map.entries()
+{
+ "_type": "object",
+ "_subtype": "iterator",
+ "_objectId": "<filtered>",
+ "_description": "Map Iterator",
+ "_preview": {
+ "_type": "object",
+ "_subtype": "iterator",
+ "_description": "Map Iterator",
+ "_lossless": false,
+ "_overflow": false,
+ "_properties": [
+ {
+ "_name": "map",
+ "_type": "object",
+ "_subtype": "map",
+ "_value": "Map",
+ "_internal": true
+ },
+ {
+ "_name": "kind",
+ "_type": "string",
+ "_value": "key+value",
+ "_internal": true
+ }
+ ],
+ "_entries": [
+ {
+ "_value": {
+ "_type": "object",
+ "_subtype": "array",
+ "_description": "Array",
+ "_lossless": true,
+ "_overflow": false,
+ "_size": 2,
+ "_properties": [
+ {
+ "_name": "0",
+ "_type": "number",
+ "_value": "1"
+ },
+ {
+ "_name": "1",
+ "_type": "number",
+ "_value": "2"
+ }
+ ],
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "object",
+ "_subtype": "array",
+ "_description": "Array",
+ "_lossless": true,
+ "_overflow": false,
+ "_size": 2,
+ "_properties": [
+ {
+ "_name": "0",
+ "_type": "string",
+ "_value": "key"
+ },
+ {
+ "_name": "1",
+ "_type": "string",
+ "_value": "value"
+ }
+ ],
+ "_entries": null
+ }
+ }
+ ]
+ }
+}
+
+-----------------------------------------------------
+EXPRESSION: x = undefined; (function() { x = arguments; })(1, 'two'); x[Symbol.iterator]()
+{
+ "_type": "object",
+ "_subtype": "iterator",
+ "_objectId": "<filtered>",
+ "_description": "ArgumentsIterator",
+ "_preview": {
+ "_type": "object",
+ "_subtype": "iterator",
+ "_description": "ArgumentsIterator",
+ "_lossless": false,
+ "_overflow": false,
+ "_properties": [
+ {
+ "_name": "arguments",
+ "_type": "object",
+ "_subtype": "array",
+ "_value": "Arguments",
+ "_internal": true
+ }
+ ],
+ "_entries": [
+ {
+ "_value": {
+ "_type": "number",
+ "_description": "1",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "string",
+ "_description": "two",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ }
+ ]
+ }
+}
+
+-----------------------------------------------------
</ins><span class="cx"> EXPRESSION: new Promise(function(){})
</span><span class="cx"> {
</span><span class="cx"> "_type": "object",
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelremoteobjecthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/model/remote-object.html (181202 => 181203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/remote-object.html        2015-03-07 03:47:52 UTC (rev 181202)
+++ trunk/LayoutTests/inspector/model/remote-object.html        2015-03-07 04:02:53 UTC (rev 181203)
</span><span class="lines">@@ -129,6 +129,21 @@
</span><span class="cx"> {expression: "set = new Set; set.add({a:1}); set.add(document.body); set.add([1,2]); set"},
</span><span class="cx"> {expression: "set = new Set; for (var i = 0; i <= 100; i++) set.add(i); set"},
</span><span class="cx">
</span><ins>+ // Iterators
+ {expression: "'a'[Symbol.iterator]()"},
+ {expression: "'long string'[Symbol.iterator]()"},
+ {expression: "[][Symbol.iterator]()"},
+ {expression: "[1][Symbol.iterator]()"},
+ {expression: "[1, 'two', 3, 'four', 5, 'size'][Symbol.iterator]()"},
+ {expression: "[1, 'two', 3, 'four', 5, 'size'].keys()"},
+ {expression: "[1, 'two', 3, 'four', 5, 'size'].entries()"},
+ {expression: "map = new Map; map.set(1, 2); map.set('key', 'value'); map.values()"},
+ {expression: "map.keys()"},
+ {expression: "map.entries()"},
+ {expression: "set = new Set; for (var i = 0; i <= 100; i++) set.add(i); set.values()"},
+ {expression: "map.entries()"},
+ {expression: "x = undefined; (function() { x = arguments; })(1, 'two'); x[Symbol.iterator]()"},
+
</ins><span class="cx"> // Promise
</span><span class="cx"> {expression: "new Promise(function(){})"},
</span><span class="cx"> {expression: "Promise.reject()"},
</span><span class="lines">@@ -159,30 +174,34 @@
</span><span class="cx"> return value;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function runNextStep() {
- if (currentStepIndex >= steps.length) {
- InspectorTest.completeTest();
- return;
</del><ins>+ function runSteps() {
+
+ function afterStep() {
+ if (++currentStepIndex >= steps.length)
+ InspectorTest.completeTest();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- var step = steps[currentStepIndex++];
- if (step.browserOnly) {
- runNextStep();
- return;
</del><ins>+ function runStep(step) {
+ if (step.browserOnly) {
+ afterStep();
+ return;
+ }
+
+ WebInspector.runtimeManager.evaluateInInspectedWindow(step.expression, "test", false, true, false, true, false, function(remoteObject, wasThrown) {
+ InspectorTest.log("");
+ InspectorTest.log("-----------------------------------------------------");
+ InspectorTest.log("EXPRESSION: " + step.expression);
+ InspectorTest.assert(remoteObject instanceof WebInspector.RemoteObject);
+ InspectorTest.log(JSON.stringify(remoteObject, remoteObjectJSONFilter, " "));
+ afterStep();
+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- InspectorTest.log("");
- InspectorTest.log("-----------------------------------------------------");
- InspectorTest.log("EXPRESSION: " + step.expression);
-
- WebInspector.runtimeManager.evaluateInInspectedWindow(step.expression, "test", false, true, false, true, false, function(remoteObject, wasThrown) {
- InspectorTest.assert(remoteObject instanceof WebInspector.RemoteObject);
- InspectorTest.log(JSON.stringify(remoteObject, remoteObjectJSONFilter, " "));
- runNextStep();
- });
</del><ins>+ for (var step of steps)
+ runStep(step);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- runNextStep();
</del><ins>+ runSteps();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function runInBrowserTest()
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (181202 => 181203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-03-07 03:47:52 UTC (rev 181202)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-03-07 04:02:53 UTC (rev 181203)
</span><span class="lines">@@ -1,3 +1,61 @@
</span><ins>+2015-03-06 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: ES6: Improved Support for Iterator Objects
+ https://bugs.webkit.org/show_bug.cgi?id=142420
+
+ Reviewed by Timothy Hatcher.
+
+ * inspector/protocol/Runtime.json:
+ Add new object subtype "iterator" for built-in iterator objects.
+
+ * inspector/InjectedScriptSource.js:
+ Return iterator values as Entry objects.
+
+ * inspector/JSInjectedScriptHost.cpp:
+ (Inspector::JSInjectedScriptHost::subtype):
+ Identify "iterator" typed objects.
+
+ (Inspector::JSInjectedScriptHost::getInternalProperties):
+ Provide internal properties for the different Iterator objects.
+
+ (Inspector::JSInjectedScriptHost::iteratorEntries):
+ Fetch the next few iterator entries of a built-in iterator object.
+
+ * inspector/JSInjectedScriptHost.h:
+ * inspector/JSInjectedScriptHostPrototype.cpp:
+ (Inspector::JSInjectedScriptHostPrototype::finishCreation):
+ (Inspector::jsInjectedScriptHostPrototypeFunctionIteratorEntries):
+ Call through to JSInjectedScriptHost.
+
+ * runtime/JSArgumentsIterator.cpp:
+ (JSC::JSArgumentsIterator::clone):
+ * runtime/JSArgumentsIterator.h:
+ (JSC::JSArgumentsIterator::iteratedValue):
+ * runtime/JSArrayIterator.cpp:
+ (JSC::JSArrayIterator::kind):
+ (JSC::JSArrayIterator::iteratedValue):
+ (JSC::JSArrayIterator::clone):
+ * runtime/JSArrayIterator.h:
+ * runtime/JSMapIterator.cpp:
+ (JSC::JSMapIterator::finishCreation):
+ (JSC::JSMapIterator::clone):
+ * runtime/JSMapIterator.h:
+ (JSC::JSMapIterator::kind):
+ (JSC::JSMapIterator::iteratedValue):
+ * runtime/JSSetIterator.cpp:
+ (JSC::JSSetIterator::finishCreation):
+ (JSC::JSSetIterator::clone):
+ * runtime/JSSetIterator.h:
+ (JSC::JSSetIterator::kind):
+ (JSC::JSSetIterator::iteratedValue):
+ * runtime/JSStringIterator.cpp:
+ (JSC::JSStringIterator::iteratedValue):
+ (JSC::JSStringIterator::clone):
+ * runtime/JSStringIterator.h:
+ Add accessors for internal properties and provide a way to clone the
+ iterator so we can be at the same index and peek at the next few
+ objects without modifying the original iterator object.
+
</ins><span class="cx"> 2015-03-06 Ryosuke Niwa <rniwa@webkit.org>
</span><span class="cx">
</span><span class="cx"> REGRESSION(r180595): construct varargs fails in FTL
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorInjectedScriptSourcejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js (181202 => 181203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2015-03-07 03:47:52 UTC (rev 181202)
+++ trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2015-03-07 04:02:53 UTC (rev 181203)
</span><span class="lines">@@ -286,7 +286,7 @@
</span><span class="cx"> if (typeof object !== "object")
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- var entries = this._getCollectionEntries(object, InjectedScriptHost.subtype(object), startIndex, numberToFetch);
</del><ins>+ var entries = this._entries(object, InjectedScriptHost.subtype(object), startIndex, numberToFetch);
</ins><span class="cx"> return entries.map(function(entry) {
</span><span class="cx"> entry.value = injectedScript._wrapObject(entry.value, objectGroupName, false, true);
</span><span class="cx"> if ("key" in entry)
</span><span class="lines">@@ -828,14 +828,21 @@
</span><span class="cx"> return InjectedScriptHost.weakMapEntries(object, numberToFetch);
</span><span class="cx"> },
</span><span class="cx">
</span><del>- _getCollectionEntries: function(object, subtype, startIndex, numberToFetch)
</del><ins>+ _getIteratorEntries: function(object, numberToFetch)
</ins><span class="cx"> {
</span><ins>+ return InjectedScriptHost.iteratorEntries(object, numberToFetch);
+ },
+
+ _entries: function(object, subtype, startIndex, numberToFetch)
+ {
</ins><span class="cx"> if (subtype === "set")
</span><span class="cx"> return this._getSetEntries(object, startIndex, numberToFetch);
</span><span class="cx"> if (subtype === "map")
</span><span class="cx"> return this._getMapEntries(object, startIndex, numberToFetch);
</span><span class="cx"> if (subtype === "weakmap")
</span><span class="cx"> return this._getWeakMapEntries(object, numberToFetch);
</span><ins>+ if (subtype === "iterator")
+ return this._getIteratorEntries(object, numberToFetch);
</ins><span class="cx">
</span><span class="cx"> throw "unexpected type";
</span><span class="cx"> },
</span><span class="lines">@@ -961,8 +968,8 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> try {
</span><del>- // Maps and Sets have entries.
- if (this.subtype === "map" || this.subtype === "set" || this.subtype === "weakmap")
</del><ins>+ // Maps, Sets, and Iterators have entries.
+ if (this.subtype === "map" || this.subtype === "set" || this.subtype === "weakmap" || this.subtype === "iterator")
</ins><span class="cx"> this._appendEntryPreviews(object, preview);
</span><span class="cx">
</span><span class="cx"> preview.properties = [];
</span><span class="lines">@@ -1112,7 +1119,7 @@
</span><span class="cx"> _appendEntryPreviews: function(object, preview)
</span><span class="cx"> {
</span><span class="cx"> // Fetch 6, but only return 5, so we can tell if we overflowed.
</span><del>- var entries = injectedScript._getCollectionEntries(object, this.subtype, 0, 6);
</del><ins>+ var entries = injectedScript._entries(object, this.subtype, 0, 6);
</ins><span class="cx"> if (!entries)
</span><span class="cx"> return;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSInjectedScriptHostcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp (181202 => 181203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp        2015-03-07 03:47:52 UTC (rev 181202)
+++ trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp        2015-03-07 04:02:53 UTC (rev 181203)
</span><span class="lines">@@ -29,13 +29,19 @@
</span><span class="cx"> #include "DateInstance.h"
</span><span class="cx"> #include "Error.h"
</span><span class="cx"> #include "InjectedScriptHost.h"
</span><ins>+#include "IteratorOperations.h"
+#include "JSArgumentsIterator.h"
</ins><span class="cx"> #include "JSArray.h"
</span><ins>+#include "JSArrayIterator.h"
</ins><span class="cx"> #include "JSBoundFunction.h"
</span><span class="cx"> #include "JSCInlines.h"
</span><span class="cx"> #include "JSFunction.h"
</span><span class="cx"> #include "JSInjectedScriptHostPrototype.h"
</span><span class="cx"> #include "JSMap.h"
</span><ins>+#include "JSMapIterator.h"
</ins><span class="cx"> #include "JSSet.h"
</span><ins>+#include "JSSetIterator.h"
+#include "JSStringIterator.h"
</ins><span class="cx"> #include "JSTypedArrays.h"
</span><span class="cx"> #include "JSWeakMap.h"
</span><span class="cx"> #include "ObjectConstructor.h"
</span><span class="lines">@@ -147,6 +153,13 @@
</span><span class="cx"> if (value.inherits(JSWeakMap::info()))
</span><span class="cx"> return jsNontrivialString(exec, ASCIILiteral("weakmap"));
</span><span class="cx">
</span><ins>+ if (value.inherits(JSArrayIterator::info())
+ || value.inherits(JSMapIterator::info())
+ || value.inherits(JSSetIterator::info())
+ || value.inherits(JSStringIterator::info())
+ || value.inherits(JSArgumentsIterator::info()))
+ return jsNontrivialString(exec, ASCIILiteral("iterator"));
+
</ins><span class="cx"> if (value.inherits(JSInt8Array::info()) || value.inherits(JSInt16Array::info()) || value.inherits(JSInt32Array::info()))
</span><span class="cx"> return jsNontrivialString(exec, ASCIILiteral("array"));
</span><span class="cx"> if (value.inherits(JSUint8Array::info()) || value.inherits(JSUint16Array::info()) || value.inherits(JSUint32Array::info()))
</span><span class="lines">@@ -250,6 +263,80 @@
</span><span class="cx"> return array;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ if (JSArrayIterator* arrayIterator = jsDynamicCast<JSArrayIterator*>(value)) {
+ String kind;
+ switch (arrayIterator->kind(exec)) {
+ case ArrayIterateKey:
+ kind = ASCIILiteral("key");
+ break;
+ case ArrayIterateValue:
+ kind = ASCIILiteral("value");
+ break;
+ case ArrayIterateKeyValue:
+ kind = ASCIILiteral("key+value");
+ break;
+ }
+ unsigned index = 0;
+ JSArray* array = constructEmptyArray(exec, nullptr, 2);
+ array->putDirectIndex(exec, index++, constructInternalProperty(exec, "array", arrayIterator->iteratedValue(exec)));
+ array->putDirectIndex(exec, index++, constructInternalProperty(exec, "kind", jsNontrivialString(exec, kind)));
+ return array;
+ }
+
+ if (JSMapIterator* mapIterator = jsDynamicCast<JSMapIterator*>(value)) {
+ String kind;
+ switch (mapIterator->kind()) {
+ case MapIterateKey:
+ kind = ASCIILiteral("key");
+ break;
+ case MapIterateValue:
+ kind = ASCIILiteral("value");
+ break;
+ case MapIterateKeyValue:
+ kind = ASCIILiteral("key+value");
+ break;
+ }
+ unsigned index = 0;
+ JSArray* array = constructEmptyArray(exec, nullptr, 2);
+ array->putDirectIndex(exec, index++, constructInternalProperty(exec, "map", mapIterator->iteratedValue()));
+ array->putDirectIndex(exec, index++, constructInternalProperty(exec, "kind", jsNontrivialString(exec, kind)));
+ return array;
+ }
+
+ if (JSSetIterator* setIterator = jsDynamicCast<JSSetIterator*>(value)) {
+ String kind;
+ switch (setIterator->kind()) {
+ case SetIterateKey:
+ kind = ASCIILiteral("key");
+ break;
+ case SetIterateValue:
+ kind = ASCIILiteral("value");
+ break;
+ case SetIterateKeyValue:
+ kind = ASCIILiteral("key+value");
+ break;
+ }
+ unsigned index = 0;
+ JSArray* array = constructEmptyArray(exec, nullptr, 2);
+ array->putDirectIndex(exec, index++, constructInternalProperty(exec, "set", setIterator->iteratedValue()));
+ array->putDirectIndex(exec, index++, constructInternalProperty(exec, "kind", jsNontrivialString(exec, kind)));
+ return array;
+ }
+
+ if (JSStringIterator* stringIterator = jsDynamicCast<JSStringIterator*>(value)) {
+ unsigned index = 0;
+ JSArray* array = constructEmptyArray(exec, nullptr, 1);
+ array->putDirectIndex(exec, index++, constructInternalProperty(exec, "string", stringIterator->iteratedValue(exec)));
+ return array;
+ }
+
+ if (JSArgumentsIterator* argumentsIterator = jsDynamicCast<JSArgumentsIterator*>(value)) {
+ unsigned index = 0;
+ JSArray* array = constructEmptyArray(exec, nullptr, 1);
+ array->putDirectIndex(exec, index++, constructInternalProperty(exec, "arguments", argumentsIterator->iteratedValue()));
+ return array;
+ }
+
</ins><span class="cx"> return jsUndefined();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -297,6 +384,55 @@
</span><span class="cx"> return array;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+JSValue JSInjectedScriptHost::iteratorEntries(ExecState* exec)
+{
+ if (exec->argumentCount() < 1)
+ return jsUndefined();
+
+ JSValue iterator;
+ JSValue value = exec->uncheckedArgument(0);
+ if (JSArrayIterator* arrayIterator = jsDynamicCast<JSArrayIterator*>(value))
+ iterator = arrayIterator->clone(exec);
+ else if (JSMapIterator* mapIterator = jsDynamicCast<JSMapIterator*>(value))
+ iterator = mapIterator->clone(exec);
+ else if (JSSetIterator* setIterator = jsDynamicCast<JSSetIterator*>(value))
+ iterator = setIterator->clone(exec);
+ else if (JSStringIterator* stringIterator = jsDynamicCast<JSStringIterator*>(value))
+ iterator = stringIterator->clone(exec);
+ else if (JSArgumentsIterator* argumentsIterator = jsDynamicCast<JSArgumentsIterator*>(value))
+ iterator = argumentsIterator->clone(exec);
+ else
+ return jsUndefined();
+
+ unsigned numberToFetch = 5;
+ JSValue numberToFetchArg = exec->argument(1);
+ double fetchDouble = numberToFetchArg.toInteger(exec);
+ if (fetchDouble >= 0)
+ numberToFetch = static_cast<unsigned>(fetchDouble);
+
+ JSArray* array = constructEmptyArray(exec, nullptr);
+
+ for (unsigned i = 0; i < numberToFetch; ++i) {
+ JSValue next = iteratorStep(exec, iterator);
+ if (exec->hadException())
+ break;
+ if (next.isFalse())
+ break;
+
+ JSValue nextValue = iteratorValue(exec, next);
+ if (exec->hadException())
+ break;
+
+ JSObject* entry = constructEmptyObject(exec);
+ entry->putDirect(exec->vm(), Identifier(exec, "value"), nextValue);
+ array->putDirectIndex(exec, i, entry);
+ }
+
+ iteratorClose(exec, iterator);
+
+ return array;
+}
+
</ins><span class="cx"> JSValue toJS(ExecState* exec, JSGlobalObject* globalObject, InjectedScriptHost* impl)
</span><span class="cx"> {
</span><span class="cx"> if (!impl)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSInjectedScriptHosth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.h (181202 => 181203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.h        2015-03-07 03:47:52 UTC (rev 181202)
+++ trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.h        2015-03-07 04:02:53 UTC (rev 181203)
</span><span class="lines">@@ -67,6 +67,7 @@
</span><span class="cx"> JSC::JSValue getInternalProperties(JSC::ExecState*);
</span><span class="cx"> JSC::JSValue weakMapSize(JSC::ExecState*);
</span><span class="cx"> JSC::JSValue weakMapEntries(JSC::ExecState*);
</span><ins>+ JSC::JSValue iteratorEntries(JSC::ExecState*);
</ins><span class="cx">
</span><span class="cx"> protected:
</span><span class="cx"> static const unsigned StructureFlags = Base::StructureFlags;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSInjectedScriptHostPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp (181202 => 181203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp        2015-03-07 03:47:52 UTC (rev 181202)
+++ trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp        2015-03-07 04:02:53 UTC (rev 181203)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionIsHTMLAllCollection(ExecState*);
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionWeakMapSize(ExecState*);
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionWeakMapEntries(ExecState*);
</span><ins>+static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionIteratorEntries(ExecState*);
</ins><span class="cx">
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeAttributeEvaluate(ExecState*);
</span><span class="cx">
</span><span class="lines">@@ -63,6 +64,7 @@
</span><span class="cx"> JSC_NATIVE_FUNCTION("isHTMLAllCollection", jsInjectedScriptHostPrototypeFunctionIsHTMLAllCollection, DontEnum, 1);
</span><span class="cx"> JSC_NATIVE_FUNCTION("weakMapSize", jsInjectedScriptHostPrototypeFunctionWeakMapSize, DontEnum, 1);
</span><span class="cx"> JSC_NATIVE_FUNCTION("weakMapEntries", jsInjectedScriptHostPrototypeFunctionWeakMapEntries, DontEnum, 1);
</span><ins>+ JSC_NATIVE_FUNCTION("iteratorEntries", jsInjectedScriptHostPrototypeFunctionIteratorEntries, DontEnum, 1);
</ins><span class="cx">
</span><span class="cx"> Identifier evaluateIdentifier(&vm, "evaluate");
</span><span class="cx"> GetterSetter* accessor = GetterSetter::create(vm, globalObject);
</span><span class="lines">@@ -126,6 +128,17 @@
</span><span class="cx"> return JSValue::encode(castedThis->weakMapEntries(exec));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionIteratorEntries(ExecState* exec)
+{
+ JSValue thisValue = exec->thisValue();
+ JSInjectedScriptHost* castedThis = jsDynamicCast<JSInjectedScriptHost*>(thisValue);
+ if (!castedThis)
+ return throwVMTypeError(exec);
+
+ ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info());
+ return JSValue::encode(castedThis->iteratorEntries(exec));
+}
+
</ins><span class="cx"> EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionSubtype(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx"> JSValue thisValue = exec->thisValue();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorprotocolRuntimejson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json (181202 => 181203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json        2015-03-07 03:47:52 UTC (rev 181202)
+++ trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json        2015-03-07 04:02:53 UTC (rev 181203)
</span><span class="lines">@@ -13,7 +13,7 @@
</span><span class="cx"> "description": "Mirror object referencing original JavaScript object.",
</span><span class="cx"> "properties": [
</span><span class="cx"> { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean", "symbol"], "description": "Object type." },
</span><del>- { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date", "error", "map", "set", "weakmap"], "description": "Object subtype hint. Specified for <code>object</code> type values only." },
</del><ins>+ { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date", "error", "map", "set", "weakmap", "iterator"], "description": "Object subtype hint. Specified for <code>object</code> type values only." },
</ins><span class="cx"> { "name": "className", "type": "string", "optional": true, "description": "Object class (constructor) name. Specified for <code>object</code> type values only." },
</span><span class="cx"> { "name": "value", "type": "any", "optional": true, "description": "Remote object value (in case of primitive values or JSON values if it was requested)." },
</span><span class="cx"> { "name": "description", "type": "string", "optional": true, "description": "String representation of the object." },
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> "description": "Object containing abbreviated remote object value.",
</span><span class="cx"> "properties": [
</span><span class="cx"> { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean", "symbol"], "description": "Object type." },
</span><del>- { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date", "error", "map", "set", "weakmap"], "description": "Object subtype hint. Specified for <code>object</code> type values only." },
</del><ins>+ { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date", "error", "map", "set", "weakmap", "iterator"], "description": "Object subtype hint. Specified for <code>object</code> type values only." },
</ins><span class="cx"> { "name": "description", "type": "string", "optional": true, "description": "String representation of the object." },
</span><span class="cx"> { "name": "lossless", "type": "boolean", "description": "Determines whether preview is lossless (contains all information of the original object)." },
</span><span class="cx"> { "name": "overflow", "type": "boolean", "optional": true, "description": "True iff some of the properties of the original did not fit." },
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> "properties": [
</span><span class="cx"> { "name": "name", "type": "string", "description": "Property name." },
</span><span class="cx"> { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean", "symbol", "accessor"], "description": "Object type." },
</span><del>- { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date", "error", "map", "set", "weakmap"], "description": "Object subtype hint. Specified for <code>object</code> type values only." },
</del><ins>+ { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date", "error", "map", "set", "weakmap", "iterator"], "description": "Object subtype hint. Specified for <code>object</code> type values only." },
</ins><span class="cx"> { "name": "value", "type": "string", "optional": true, "description": "User-friendly property value string." },
</span><span class="cx"> { "name": "valuePreview", "$ref": "ObjectPreview", "optional": true, "description": "Nested value preview." },
</span><span class="cx"> { "name": "internal", "type": "boolean", "optional": true, "description": "True if this is an internal property." }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSArgumentsIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSArgumentsIterator.cpp (181202 => 181203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSArgumentsIterator.cpp        2015-03-07 03:47:52 UTC (rev 181202)
+++ trunk/Source/JavaScriptCore/runtime/JSArgumentsIterator.cpp        2015-03-07 04:02:53 UTC (rev 181203)
</span><span class="lines">@@ -39,4 +39,11 @@
</span><span class="cx"> m_arguments.set(vm, this, arguments);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+JSArgumentsIterator* JSArgumentsIterator::clone(ExecState* exec)
+{
+ auto clone = JSArgumentsIterator::create(exec->vm(), exec->callee()->globalObject()->argumentsIteratorStructure(), m_arguments.get());
+ clone->m_nextIndex = m_nextIndex;
+ return clone;
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSArgumentsIteratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSArgumentsIterator.h (181202 => 181203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSArgumentsIterator.h        2015-03-07 03:47:52 UTC (rev 181202)
+++ trunk/Source/JavaScriptCore/runtime/JSArgumentsIterator.h        2015-03-07 04:02:53 UTC (rev 181203)
</span><span class="lines">@@ -58,6 +58,9 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ JSValue iteratedValue() const { return m_arguments.get(); }
+ JSArgumentsIterator* clone(ExecState*);
+
</ins><span class="cx"> private:
</span><span class="cx">
</span><span class="cx"> static const unsigned StructureFlags = Base::StructureFlags;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSArrayIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSArrayIterator.cpp (181202 => 181203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSArrayIterator.cpp        2015-03-07 03:47:52 UTC (rev 181202)
+++ trunk/Source/JavaScriptCore/runtime/JSArrayIterator.cpp        2015-03-07 04:02:53 UTC (rev 181203)
</span><span class="lines">@@ -45,4 +45,26 @@
</span><span class="cx"> putDirect(vm, vm.propertyNames->arrayIterationKindPrivateName, jsNumber(kind));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ArrayIterationKind JSArrayIterator::kind(ExecState* exec) const
+{
+ JSValue kindValue = getDirect(exec->vm(), exec->vm().propertyNames->arrayIterationKindPrivateName);
+ return static_cast<ArrayIterationKind>(kindValue.asInt32());
</ins><span class="cx"> }
</span><ins>+
+JSValue JSArrayIterator::iteratedValue(ExecState* exec) const
+{
+ return getDirect(exec->vm(), exec->vm().propertyNames->iteratedObjectPrivateName);
+}
+
+JSArrayIterator* JSArrayIterator::clone(ExecState* exec)
+{
+ VM& vm = exec->vm();
+ JSValue iteratedObject = getDirect(vm, vm.propertyNames->iteratedObjectPrivateName);
+ JSValue nextIndex = getDirect(vm, vm.propertyNames->arrayIteratorNextIndexPrivateName);
+
+ auto clone = JSArrayIterator::create(exec, exec->callee()->globalObject()->arrayIteratorStructure(), kind(exec), asObject(iteratedObject));
+ clone->putDirect(vm, vm.propertyNames->arrayIteratorNextIndexPrivateName, nextIndex);
+ return clone;
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSArrayIteratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSArrayIterator.h (181202 => 181203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSArrayIterator.h        2015-03-07 03:47:52 UTC (rev 181202)
+++ trunk/Source/JavaScriptCore/runtime/JSArrayIterator.h        2015-03-07 04:02:53 UTC (rev 181203)
</span><span class="lines">@@ -55,6 +55,10 @@
</span><span class="cx"> return instance;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ ArrayIterationKind kind(ExecState*) const;
+ JSValue iteratedValue(ExecState*) const;
+ JSArrayIterator* clone(ExecState*);
+
</ins><span class="cx"> using JSNonFinalObject::arrayStorageOrNull;
</span><span class="cx"> private:
</span><span class="cx"> JSArrayIterator(VM& vm, Structure* structure)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSMapIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSMapIterator.cpp (181202 => 181203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSMapIterator.cpp        2015-03-07 03:47:52 UTC (rev 181202)
+++ trunk/Source/JavaScriptCore/runtime/JSMapIterator.cpp        2015-03-07 04:02:53 UTC (rev 181203)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> void JSMapIterator::finishCreation(VM& vm, JSMap* iteratedObject)
</span><span class="cx"> {
</span><span class="cx"> Base::finishCreation(vm);
</span><ins>+ m_map.set(vm, this, iteratedObject);
</ins><span class="cx"> m_iteratedObjectData.set(vm, this, iteratedObject->mapData());
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -59,4 +60,11 @@
</span><span class="cx"> return constructArray(callFrame, 0, globalObject, args);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+JSMapIterator* JSMapIterator::clone(ExecState* exec)
+{
+ auto clone = JSMapIterator::create(exec->vm(), exec->callee()->globalObject()->mapIteratorStructure(), m_map.get(), m_kind);
+ clone->m_iterator = m_iterator;
+ return clone;
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSMapIteratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSMapIterator.h (181202 => 181203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSMapIterator.h        2015-03-07 03:47:52 UTC (rev 181202)
+++ trunk/Source/JavaScriptCore/runtime/JSMapIterator.h        2015-03-07 04:02:53 UTC (rev 181203)
</span><span class="lines">@@ -75,6 +75,10 @@
</span><span class="cx"> m_iterator.finish();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ MapIterationKind kind() const { return m_kind; }
+ JSValue iteratedValue() const { return m_map.get(); }
+ JSMapIterator* clone(ExecState*);
+
</ins><span class="cx"> private:
</span><span class="cx"> JSMapIterator(VM& vm, Structure* structure, JSMap* iteratedObject, MapIterationKind kind)
</span><span class="cx"> : Base(vm, structure)
</span><span class="lines">@@ -87,6 +91,7 @@
</span><span class="cx"> JSValue createPair(CallFrame*, JSValue, JSValue);
</span><span class="cx"> static void visitChildren(JSCell*, SlotVisitor&);
</span><span class="cx">
</span><ins>+ WriteBarrier<JSMap> m_map;
</ins><span class="cx"> WriteBarrier<MapData> m_iteratedObjectData;
</span><span class="cx"> MapData::const_iterator m_iterator;
</span><span class="cx"> MapIterationKind m_kind;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSSetIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSSetIterator.cpp (181202 => 181203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSSetIterator.cpp        2015-03-07 03:47:52 UTC (rev 181202)
+++ trunk/Source/JavaScriptCore/runtime/JSSetIterator.cpp        2015-03-07 04:02:53 UTC (rev 181203)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> void JSSetIterator::finishCreation(VM& vm, JSSet* iteratedObject)
</span><span class="cx"> {
</span><span class="cx"> Base::finishCreation(vm);
</span><ins>+ m_set.set(vm, this, iteratedObject);
</ins><span class="cx"> m_iteratedObjectData.set(vm, this, iteratedObject->mapData());
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -59,4 +60,11 @@
</span><span class="cx"> return constructArray(callFrame, 0, globalObject, args);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+JSSetIterator* JSSetIterator::clone(ExecState* exec)
+{
+ auto clone = JSSetIterator::create(exec->vm(), exec->callee()->globalObject()->setIteratorStructure(), m_set.get(), m_kind);
+ clone->m_iterator = m_iterator;
+ return clone;
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSSetIteratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSSetIterator.h (181202 => 181203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSSetIterator.h        2015-03-07 03:47:52 UTC (rev 181202)
+++ trunk/Source/JavaScriptCore/runtime/JSSetIterator.h        2015-03-07 04:02:53 UTC (rev 181203)
</span><span class="lines">@@ -73,6 +73,10 @@
</span><span class="cx"> m_iterator.finish();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ SetIterationKind kind() const { return m_kind; }
+ JSValue iteratedValue() const { return m_set.get(); }
+ JSSetIterator* clone(ExecState*);
+
</ins><span class="cx"> private:
</span><span class="cx"> JSSetIterator(VM& vm, Structure* structure, JSSet* iteratedObject, SetIterationKind kind)
</span><span class="cx"> : Base(vm, structure)
</span><span class="lines">@@ -85,6 +89,7 @@
</span><span class="cx"> JSValue createPair(CallFrame*, JSValue, JSValue);
</span><span class="cx"> static void visitChildren(JSCell*, SlotVisitor&);
</span><span class="cx">
</span><ins>+ WriteBarrier<JSSet> m_set;
</ins><span class="cx"> WriteBarrier<MapData> m_iteratedObjectData;
</span><span class="cx"> MapData::const_iterator m_iterator;
</span><span class="cx"> SetIterationKind m_kind;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSStringIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSStringIterator.cpp (181202 => 181203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSStringIterator.cpp        2015-03-07 03:47:52 UTC (rev 181202)
+++ trunk/Source/JavaScriptCore/runtime/JSStringIterator.cpp        2015-03-07 04:02:53 UTC (rev 181203)
</span><span class="lines">@@ -42,4 +42,20 @@
</span><span class="cx"> putDirect(vm, vm.propertyNames->stringIteratorNextIndexPrivateName, jsNumber(0));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+JSValue JSStringIterator::iteratedValue(ExecState* exec) const
+{
+ return getDirect(exec->vm(), exec->vm().propertyNames->iteratedStringPrivateName);
+}
+
+JSStringIterator* JSStringIterator::clone(ExecState* exec)
+{
+ VM& vm = exec->vm();
+ JSValue iteratedString = getDirect(vm, vm.propertyNames->iteratedStringPrivateName);
+ JSValue nextIndex = getDirect(vm, vm.propertyNames->stringIteratorNextIndexPrivateName);
+
+ auto clone = JSStringIterator::create(exec, exec->callee()->globalObject()->stringIteratorStructure(), asString(iteratedString));
+ clone->putDirect(vm, vm.propertyNames->stringIteratorNextIndexPrivateName, nextIndex);
+ return clone;
+}
+
</ins><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSStringIteratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSStringIterator.h (181202 => 181203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSStringIterator.h        2015-03-07 03:47:52 UTC (rev 181202)
+++ trunk/Source/JavaScriptCore/runtime/JSStringIterator.h        2015-03-07 04:02:53 UTC (rev 181203)
</span><span class="lines">@@ -49,6 +49,9 @@
</span><span class="cx"> return instance;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ JSValue iteratedValue(ExecState*) const;
+ JSStringIterator* clone(ExecState*);
+
</ins><span class="cx"> private:
</span><span class="cx"> JSStringIterator(VM& vm, Structure* structure)
</span><span class="cx"> : Base(vm, structure)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (181202 => 181203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-03-07 03:47:52 UTC (rev 181202)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-03-07 04:02:53 UTC (rev 181203)
</span><span class="lines">@@ -1,5 +1,19 @@
</span><span class="cx"> 2015-03-06 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><ins>+ Web Inspector: ES6: Improved Support for Iterator Objects
+ https://bugs.webkit.org/show_bug.cgi?id=142420
+
+ Reviewed by Timothy Hatcher.
+
+ * UserInterface/Views/ConsoleMessageImpl.js:
+ (WebInspector.ConsoleMessageImpl):
+ Treat an iterator like an object.
+
+ * UserInterface/Views/ObjectPreviewView.js:
+ Output iterator previews with []s, not {}s.
+
+2015-03-06 Joseph Pecoraro <pecoraro@apple.com>
+
</ins><span class="cx"> Web Inspector: Adopt Object Literal Method Property Syntax
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=142409
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsConsoleMessageImpljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageImpl.js (181202 => 181203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageImpl.js        2015-03-07 03:47:52 UTC (rev 181202)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageImpl.js        2015-03-07 04:02:53 UTC (rev 181203)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx"> "map": this._formatParameterAsObject,
</span><span class="cx"> "set": this._formatParameterAsObject,
</span><span class="cx"> "weakmap": this._formatParameterAsObject,
</span><ins>+ "iterator": this._formatParameterAsObject,
</ins><span class="cx"> "array": this._formatParameterAsArray,
</span><span class="cx"> "node": this._formatParameterAsNode,
</span><span class="cx"> "string": this._formatParameterAsString
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsObjectPreviewViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js (181202 => 181203)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js        2015-03-07 03:47:52 UTC (rev 181202)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js        2015-03-07 04:02:53 UTC (rev 181203)
</span><span class="lines">@@ -144,8 +144,10 @@
</span><span class="cx"> {
</span><span class="cx"> var lossless = preview.lossless && !preview.propertyPreviews.length;
</span><span class="cx">
</span><del>- element.appendChild(document.createTextNode("{"));
</del><ins>+ var isIterator = preview.subtype === "iterator";
</ins><span class="cx">
</span><ins>+ element.appendChild(document.createTextNode(isIterator ? "[" : "{"));
+
</ins><span class="cx"> var limit = Math.min(preview.collectionEntryPreviews.length, this._numberOfPropertiesToShowInMode());
</span><span class="cx"> for (var i = 0; i < limit; ++i) {
</span><span class="cx"> if (i > 0)
</span><span class="lines">@@ -166,7 +168,7 @@
</span><span class="cx">
</span><span class="cx"> if (preview.overflow)
</span><span class="cx"> element.appendChild(document.createTextNode(", \u2026"));
</span><del>- element.appendChild(document.createTextNode("}"));
</del><ins>+ element.appendChild(document.createTextNode(isIterator ? "]" : "}"));
</ins><span class="cx">
</span><span class="cx"> return lossless;
</span><span class="cx"> },
</span></span></pre>
</div>
</div>
</body>
</html>