Index: src/runtime.js |
diff --git a/src/runtime.js b/src/runtime.js |
index de64541496f41ac4ce59cc7836943588804a0acb..160d82cd88ab6a9682fcf416e15083611924337d 100644 |
--- a/src/runtime.js |
+++ b/src/runtime.js |
@@ -732,12 +732,12 @@ function ToInteger(x) { |
} |
-// ES6, draft 08-24-14, section 7.1.15 |
+// ES6, section 7.1.15 |
function ToLength(arg) { |
- arg = ToInteger(arg); |
- if (arg < 0) return 0; |
- return arg < GlobalNumber.MAX_SAFE_INTEGER ? arg |
- : GlobalNumber.MAX_SAFE_INTEGER; |
+ arg = TO_NUMBER_INLINE(arg); |
adamk
2015/08/24 22:42:17
Not sure what the state of the art is...should thi
|
+ if (arg <= 0) return 0; |
+ arg = %_MathFloor(arg); |
+ return arg < kMaxSafeInteger ? arg : kMaxSafeInteger; |
} |