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

Unified Diff: src/runtime.js

Issue 363833006: Implement Array.from() (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add tests for calling mapfn with/without receiver in/out of sloppy mode 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) {
rossberg 2014/09/10 07:23:55 This should be ToLength, and move to the next sect
caitp (gmail) 2014/09/10 14:26:05 As you saw, this was moved into a separate CL so t
+ arg = ToInteger(arg);
+ if (arg < +0) {
rossberg 2014/09/10 07:23:55 Nit: The + is redundant (and may potentially be mo
caitp (gmail) 2014/09/10 14:26:04 Removed in crrev.com/552273002
+ 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