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

Unified Diff: src/runtime.js

Issue 552273002: Implement ToLength from ES6 section 7.1.15 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.js
diff --git a/src/runtime.js b/src/runtime.js
index d9e1fe5c994030f40461167faac8b3df4d60ff22..52db9d1f6989e0b154c3639d87f48984b0b2a6af 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -591,6 +591,14 @@ function SameValue(x, y) {
}
+// ES6, draft 08-24-14, section 7.1.15
rossberg 2014/09/10 07:29:51 Nit: move this next to ToInteger
caitp (gmail) 2014/09/10 11:49:40 Acknowledged.
+function ToLength(arg) {
+ arg = ToInteger(arg);
+ if (arg < +0) return 0;
rossberg 2014/09/10 07:29:51 Nit: remove the +
caitp (gmail) 2014/09/10 11:49:40 Acknowledged.
+ return arg < $Number.MAX_SAFE_INTEGER ? arg : $Number.MAX_SAFE_INTEGER;
+}
+
+
/* ---------------------------------
- - - U t i l i t i e s - - -
---------------------------------
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698