Index: src/runtime.js |
diff --git a/src/runtime.js b/src/runtime.js |
index c3b8ed22a1c4d6135d7ab9b13dc90b7f1d38de35..0e82d862bd7d70e9d0fe6f7f96ddf35c946922ba 100644 |
--- a/src/runtime.js |
+++ b/src/runtime.js |
@@ -15,8 +15,6 @@ var $NaN; |
var $nonNumberToNumber; |
var $sameValue; |
var $sameValueZero; |
-var $toInteger; |
-var $toLength; |
var $toNumber; |
var $toPositiveInteger; |
@@ -97,7 +95,7 @@ function REFLECT_APPLY_PREPARE(args) { |
throw %make_type_error(kWrongArgs, "Reflect.apply"); |
} |
- length = %to_length_fun(args.length); |
+ length = TO_LENGTH(args.length); |
// We can handle any number of apply arguments if the stack is |
// big enough, but sanity check the value to avoid overflow when |
@@ -147,7 +145,7 @@ function REFLECT_CONSTRUCT_PREPARE( |
throw %make_type_error(kWrongArgs, "Reflect.construct"); |
} |
- length = %to_length_fun(args.length); |
+ length = TO_LENGTH(args.length); |
// We can handle any number of apply arguments if the stack is |
// big enough, but sanity check the value to avoid overflow when |
@@ -216,21 +214,6 @@ function ToString(x) { |
} |
-// ECMA-262, section 9.4, page 34. |
-function ToInteger(x) { |
- if (%_IsSmi(x)) return x; |
- return %NumberToInteger(ToNumber(x)); |
-} |
- |
- |
-// ES6, draft 08-24-14, section 7.1.15 |
-function ToLength(arg) { |
- arg = ToInteger(arg); |
- if (arg < 0) return 0; |
- return arg < kMaxSafeInteger ? arg : kMaxSafeInteger; |
-} |
- |
- |
// ES5, section 9.12 |
function SameValue(x, y) { |
if (typeof x != typeof y) return false; |
@@ -348,8 +331,6 @@ $NaN = %GetRootNaN(); |
$nonNumberToNumber = NonNumberToNumber; |
$sameValue = SameValue; |
$sameValueZero = SameValueZero; |
-$toInteger = ToInteger; |
-$toLength = ToLength; |
$toNumber = ToNumber; |
$toPositiveInteger = ToPositiveInteger; |
@@ -363,14 +344,11 @@ $toPositiveInteger = ToPositiveInteger; |
%InstallToContext([ |
"concat_iterable_to_array", ConcatIterableToArray, |
"non_number_to_number", NonNumberToNumber, |
- "to_integer_fun", ToInteger, |
- "to_length_fun", ToLength, |
"to_number_fun", ToNumber, |
]); |
utils.Export(function(to) { |
to.ToBoolean = ToBoolean; |
- to.ToLength = ToLength; |
to.ToNumber = ToNumber; |
to.ToString = ToString; |
}); |