Modified: trunk/LayoutTests/inspector/model/remote-object-expected.txt (187958 => 187959)
--- trunk/LayoutTests/inspector/model/remote-object-expected.txt 2015-08-05 10:27:18 UTC (rev 187958)
+++ trunk/LayoutTests/inspector/model/remote-object-expected.txt 2015-08-05 14:04:47 UTC (rev 187959)
@@ -3748,6 +3748,162 @@
}
-----------------------------------------------------
+_expression_: Reflect.enumerate({a:1, b:2, c:3})
+{
+ "_type": "object",
+ "_subtype": "iterator",
+ "_objectId": "<filtered>",
+ "_description": "PropertyName Iterator",
+ "_preview": {
+ "_type": "object",
+ "_subtype": "iterator",
+ "_description": "PropertyName Iterator",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": [
+ {
+ "_name": "object",
+ "_type": "object",
+ "_valuePreview": {
+ "_type": "object",
+ "_description": "Object",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": [
+ {
+ "_name": "a",
+ "_type": "number",
+ "_value": "1"
+ },
+ {
+ "_name": "b",
+ "_type": "number",
+ "_value": "2"
+ },
+ {
+ "_name": "c",
+ "_type": "number",
+ "_value": "3"
+ }
+ ],
+ "_entries": null
+ },
+ "_internal": true
+ }
+ ],
+ "_entries": [
+ {
+ "_value": {
+ "_type": "string",
+ "_description": "a",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "string",
+ "_description": "b",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "string",
+ "_description": "c",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ }
+ ]
+ }
+}
+
+-----------------------------------------------------
+_expression_: Reflect.enumerate([1, 2, 3, 4, 5, 6, 7])
+{
+ "_type": "object",
+ "_subtype": "iterator",
+ "_objectId": "<filtered>",
+ "_description": "PropertyName Iterator",
+ "_preview": {
+ "_type": "object",
+ "_subtype": "iterator",
+ "_description": "PropertyName Iterator",
+ "_lossless": false,
+ "_overflow": true,
+ "_properties": [
+ {
+ "_name": "object",
+ "_type": "object",
+ "_subtype": "array",
+ "_value": "Array",
+ "_internal": true
+ }
+ ],
+ "_entries": [
+ {
+ "_value": {
+ "_type": "string",
+ "_description": "0",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "string",
+ "_description": "1",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "string",
+ "_description": "2",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "string",
+ "_description": "3",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ },
+ {
+ "_value": {
+ "_type": "string",
+ "_description": "4",
+ "_lossless": true,
+ "_overflow": false,
+ "_properties": null,
+ "_entries": null
+ }
+ }
+ ]
+ }
+}
+
+-----------------------------------------------------
_expression_: new Promise(function(){})
{
"_type": "object",
Modified: trunk/LayoutTests/inspector/model/remote-object.html (187958 => 187959)
--- trunk/LayoutTests/inspector/model/remote-object.html 2015-08-05 10:27:18 UTC (rev 187958)
+++ trunk/LayoutTests/inspector/model/remote-object.html 2015-08-05 14:04:47 UTC (rev 187959)
@@ -155,6 +155,8 @@
{_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]()"},
+ {_expression_: "Reflect.enumerate({a:1, b:2, c:3})"},
+ {_expression_: "Reflect.enumerate([1, 2, 3, 4, 5, 6, 7])"},
// Promise
{_expression_: "new Promise(function(){})"},
Modified: trunk/Source/_javascript_Core/inspector/JSInjectedScriptHost.cpp (187958 => 187959)
--- trunk/Source/_javascript_Core/inspector/JSInjectedScriptHost.cpp 2015-08-05 10:27:18 UTC (rev 187958)
+++ trunk/Source/_javascript_Core/inspector/JSInjectedScriptHost.cpp 2015-08-05 14:04:47 UTC (rev 187959)
@@ -40,6 +40,7 @@
#include "JSMap.h"
#include "JSMapIterator.h"
#include "JSPromise.h"
+#include "JSPropertyNameIterator.h"
#include "JSSet.h"
#include "JSSetIterator.h"
#include "JSStringIterator.h"
@@ -165,7 +166,8 @@
if (value.inherits(JSArrayIterator::info())
|| value.inherits(JSMapIterator::info())
|| value.inherits(JSSetIterator::info())
- || value.inherits(JSStringIterator::info()))
+ || value.inherits(JSStringIterator::info())
+ || value.inherits(JSPropertyNameIterator::info()))
return jsNontrivialString(exec, ASCIILiteral("iterator"));
if (value.inherits(JSInt8Array::info()) || value.inherits(JSInt16Array::info()) || value.inherits(JSInt32Array::info()))
@@ -336,6 +338,13 @@
return array;
}
+ if (JSPropertyNameIterator* propertyNameIterator = jsDynamicCast<JSPropertyNameIterator*>(value)) {
+ unsigned index = 0;
+ JSArray* array = constructEmptyArray(exec, nullptr, 1);
+ array->putDirectIndex(exec, index++, constructInternalProperty(exec, "object", propertyNameIterator->iteratedValue()));
+ return array;
+ }
+
return jsUndefined();
}
@@ -441,6 +450,8 @@
iterator = setIterator->clone(exec);
else if (JSStringIterator* stringIterator = jsDynamicCast<JSStringIterator*>(value))
iterator = stringIterator->clone(exec);
+ else if (JSPropertyNameIterator* propertyNameIterator = jsDynamicCast<JSPropertyNameIterator*>(value))
+ iterator = propertyNameIterator->clone(exec);
else
return jsUndefined();