Index: src/v8natives.js |
diff --git a/src/v8natives.js b/src/v8natives.js |
index 9a8e4e37d81729858228ba62d25eff84ad1635e6..94f7968b660eb320f2b826e29a5fbd329b164d27 100644 |
--- a/src/v8natives.js |
+++ b/src/v8natives.js |
@@ -1017,7 +1017,8 @@ function ObjectGetOwnPropertyNames(obj) { |
// Find all the indexed properties. |
// Get the local element names. |
- var propertyNames = %GetLocalElementNames(obj); |
+ var propertyNames = new InternalArray; |
+ %MoveArrayContents(%GetLocalElementNames(obj), propertyNames); |
for (var i = 0; i < propertyNames.length; ++i) { |
propertyNames[i] = %_NumberToString(propertyNames[i]); |
} |
@@ -1065,7 +1066,9 @@ function ObjectGetOwnPropertyNames(obj) { |
propertyNames.length = j; |
} |
- return propertyNames; |
+ var result = []; |
Vyacheslav Egorov (Google)
2013/02/26 01:21:33
I wonder if it should be new $Array() for consiste
adamk
2013/02/26 02:28:12
Changed to $Array.
|
+ %MoveArrayContents(propertyNames, result); |
+ return result; |
} |