Commit 6e02204d authored by jgruber's avatar jgruber Committed by Commit Bot

Remove unused code in JS builtins

Change-Id: I7d5d9ff4d69628573586c1a8e5704d2b6009adc8
Reviewed-on: https://chromium-review.googlesource.com/980534Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52250}
parent 8c7bfc54
......@@ -11,8 +11,6 @@
// -------------------------------------------------------------------
// Imports
var GetIterator;
var GetMethod;
var GlobalArray = global.Array;
var InternalArray = utils.InternalArray;
var MathMax = global.Math.max;
......@@ -22,11 +20,6 @@ var ObjectToString = global.Object.prototype.toString;
var iteratorSymbol = utils.ImportNow("iterator_symbol");
var unscopablesSymbol = utils.ImportNow("unscopables_symbol");
utils.Import(function(from) {
GetIterator = from.GetIterator;
GetMethod = from.GetMethod;
});
// -------------------------------------------------------------------
macro IS_PROXY(arg)
......
......@@ -99,42 +99,6 @@ function PostNatives(utils) {
utils.PostNatives = UNDEFINED;
}
// ----------------------------------------------------------------------------
// Object
var iteratorSymbol = ImportNow("iterator_symbol");
// ES6 7.3.9
function GetMethod(obj, p) {
var func = obj[p];
if (IS_NULL_OR_UNDEFINED(func)) return UNDEFINED;
if (IS_CALLABLE(func)) return func;
throw %make_type_error(kCalledNonCallable, typeof func);
}
// ----------------------------------------------------------------------------
// Iterator related spec functions.
// ES6 7.4.1 GetIterator(obj, method)
function GetIterator(obj, method) {
if (IS_UNDEFINED(method)) {
method = obj[iteratorSymbol];
}
if (!IS_CALLABLE(method)) {
throw %make_type_error(kNotIterable, obj);
}
var iterator = %_Call(method, obj);
if (!IS_RECEIVER(iterator)) {
throw %make_type_error(kNotAnIterator, iterator);
}
return iterator;
}
exports_container.GetIterator = GetIterator;
exports_container.GetMethod = GetMethod;
// -----------------------------------------------------------------------
%OptimizeObjectForAddingMultipleProperties(utils, 14);
......
......@@ -13,13 +13,9 @@
// array.js has to come before typedarray.js for this to work
var ArrayToString = utils.ImportNow("ArrayToString");
var GetIterator;
var GetMethod;
var InnerArrayJoin;
var InnerArraySort;
var InnerArrayToLocaleString;
var InternalArray = utils.InternalArray;
var iteratorSymbol = utils.ImportNow("iterator_symbol");
macro TYPED_ARRAYS(FUNCTION)
FUNCTION(Uint8Array, 1)
......@@ -48,8 +44,6 @@ endmacro
var GlobalTypedArray = %object_get_prototype_of(GlobalUint8Array);
utils.Import(function(from) {
GetIterator = from.GetIterator;
GetMethod = from.GetMethod;
InnerArrayJoin = from.InnerArrayJoin;
InnerArraySort = from.InnerArraySort;
InnerArrayToLocaleString = from.InnerArrayToLocaleString;
......@@ -65,19 +59,6 @@ function ValidateTypedArray(array, methodName) {
throw %make_type_error(kDetachedOperation, methodName);
}
function TypedArrayCreate(constructor, arg0, arg1, arg2) {
if (IS_UNDEFINED(arg1)) {
var newTypedArray = new constructor(arg0);
} else {
var newTypedArray = new constructor(arg0, arg1, arg2);
}
ValidateTypedArray(newTypedArray, "TypedArrayCreate");
if (IS_NUMBER(arg0) && %_TypedArrayGetLength(newTypedArray) < arg0) {
throw %make_type_error(kTypedArrayTooShort);
}
return newTypedArray;
}
// ES6 draft 05-18-15, section 22.2.3.25
DEFINE_METHOD(
GlobalTypedArray.prototype,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment