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

Unified Diff: src/runtime.js

Issue 363833006: Implement Array.from() (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Update expected builtins Created 6 years, 5 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/runtime.js
diff --git a/src/runtime.js b/src/runtime.js
index c070a1119e7bdadec9679c56e71b435538baa70e..ba99113e75c950fb7c4ad96219764d0eb17b6af6 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -464,6 +464,16 @@ function TO_STRING() {
}
+// ES6, draft 05-22-14, section 7.1.15
+function TO_LENGTH(arg) {
+ arg = ToInteger(arg);
+ if (arg < +0) {
+ return 0;
+ }
+ return arg < $Number.MAX_SAFE_INTEGER ? arg : $Number.MAX_SAFE_INTEGER;
+}
+
+
/* -------------------------------------
- - - C o n v e r s i o n s - - -
-------------------------------------

Powered by Google App Engine
This is Rietveld 408576698