Index: src/v8natives.js |
diff --git a/src/v8natives.js b/src/v8natives.js |
index 5ffff2ecacd9f789d475595aa506c3093d20bfe4..576186a8a723555c3661a84c234b3107e73e9efb 100644 |
--- a/src/v8natives.js |
+++ b/src/v8natives.js |
@@ -1171,13 +1171,25 @@ function ObjectDefineProperty(obj, p, attributes) { |
} |
-function GetOwnEnumerablePropertyNames(properties) { |
+function GetOwnEnumerablePropertyNames(object) { |
var names = new InternalArray(); |
- for (var key in properties) { |
- if (%HasOwnProperty(properties, key)) { |
+ for (var key in object) { |
+ if (%HasOwnProperty(object, key)) { |
names.push(key); |
} |
} |
+ |
+ // FLAG_harmony_symbols may be on, but symbols aren't included by for-in. |
+ var filter = PROPERTY_ATTRIBUTES_STRING | PROPERTY_ATTRIBUTES_PRIVATE_SYMBOL; |
arv (Not doing code reviews)
2014/07/14 13:29:17
Why don't you include string property keys here to
rossberg
2014/07/14 13:50:10
Unfortunately, that would miss out on indexed prop
|
+ var symbols = %GetOwnPropertyNames(object, filter); |
+ for (var i = 0; i < symbols.length; ++i) { |
+ var symbol = symbols[i]; |
+ if (IS_SYMBOL(symbol)) { |
+ var desc = ObjectGetOwnPropertyDescriptor(object, symbol); |
+ if (desc.enumerable) names.push(symbol); |
+ } |
+ } |
+ |
return names; |
} |