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

Unified Diff: src/runtime.cc

Issue 3132046: Add sparse array handling to Array.protoype.indexOf/lastIndexOf. (Closed)
Patch Set: Add tests, and fix bugs found by tests. Created 10 years, 4 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
« no previous file with comments | « src/array.js ('k') | test/mjsunit/array-indexing.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 1122d331a4fd0519799fc6bf2b97ace49889109c..7cfd5a659bea55e869467b5e5c7101f196368138 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -8199,8 +8199,10 @@ static Object* Runtime_SwapElements(Arguments args) {
// Returns an array that tells you where in the [0, length) interval an array
-// might have elements. Can either return keys or intervals. Keys can have
-// gaps in (undefined). Intervals can also span over some undefined keys.
+// might have elements. Can either return keys (positive integers) or
+// intervals (pair of a negative integer (-start-1) followed by a
+// positive (length)) or undefined values.
+// Intervals can span over some keys that are not in the object.
static Object* Runtime_GetArrayKeys(Arguments args) {
ASSERT(args.length() == 2);
HandleScope scope;
« no previous file with comments | « src/array.js ('k') | test/mjsunit/array-indexing.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698