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

Unified Diff: src/runtime.js

Issue 553623004: ES6: Array.prototype.slice and friends should use ToLength instead of ToUint32 Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove failing tests. Created 5 years, 10 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/harmony-templates.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.js
diff --git a/src/runtime.js b/src/runtime.js
index 7d82dfa8463fac3305ca98f42dd9a5545444a40c..8919434fb48fd8aa2825ab720fd5fc6b53d136ef 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -577,7 +577,10 @@ function ToInteger(x) {
// ES6, draft 08-24-14, section 7.1.15
+// TODO(rossberg): Remove use of flag once --harmony-arrays is gone.
+ToLength.harmony = false;
function ToLength(arg) {
+ if (!ToLength.harmony) return TO_UINT32(arg);
arg = ToInteger(arg);
if (arg < 0) return 0;
return arg < $Number.MAX_SAFE_INTEGER ? arg : $Number.MAX_SAFE_INTEGER;
« no previous file with comments | « src/harmony-templates.js ('k') | test/mjsunit/array-indexing.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698