Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Unified Diff: src/v8natives.js

Issue 12342003: Use InternalArray in Object.getOwnPropertyNames() implementation (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}
« src/array.js ('K') | « src/array.js ('k') | test/mjsunit/object-get-own-property-names.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698