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

Unified Diff: src/runtime.js

Issue 363833006: Implement Array.from() (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments, rebased Created 6 years, 3 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 d9e1fe5c994030f40461167faac8b3df4d60ff22..d49b6d267dd2c93d69daaca86caa07282b268bf6 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -465,6 +465,16 @@ function TO_STRING() {
}
+// ES6, draft 07-18-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