зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 2021fd52a8c9 (bug 1041586)
This commit is contained in:
Родитель
b96ed92209
Коммит
50c708e702
|
@ -942,23 +942,6 @@ function ArraySpeciesCreate(originalArray, length) {
|
||||||
return new C(length);
|
return new C(length);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ES 2017 draft (April 8, 2016) 22.1.3.1.1
|
|
||||||
function IsConcatSpreadable(O) {
|
|
||||||
// Step 1.
|
|
||||||
if (!IsObject(O))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Step 2.
|
|
||||||
var spreadable = O[std_isConcatSpreadable];
|
|
||||||
|
|
||||||
// Step 3.
|
|
||||||
if (spreadable !== undefined)
|
|
||||||
return ToBoolean(spreadable);
|
|
||||||
|
|
||||||
// Step 4.
|
|
||||||
return IsArray(O);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ES 2016 draft Mar 25, 2016 22.1.3.1.
|
// ES 2016 draft Mar 25, 2016 22.1.3.1.
|
||||||
// Note: Array.prototype.concat.length is 1.
|
// Note: Array.prototype.concat.length is 1.
|
||||||
function ArrayConcat(arg1) {
|
function ArrayConcat(arg1) {
|
||||||
|
@ -982,7 +965,8 @@ function ArrayConcat(arg1) {
|
||||||
var k, len;
|
var k, len;
|
||||||
while (true) {
|
while (true) {
|
||||||
// Steps 5.b-c.
|
// Steps 5.b-c.
|
||||||
if (IsConcatSpreadable(E)) {
|
// IsArray should be replaced with IsConcatSpreadable (bug 1041586).
|
||||||
|
if (IsArray(E)) {
|
||||||
// Step 5.c.ii.
|
// Step 5.c.ii.
|
||||||
len = ToLength(E.length);
|
len = ToLength(E.length);
|
||||||
|
|
||||||
|
|
|
@ -445,14 +445,6 @@ GlobalObject::initSelfHostingBuiltins(JSContext* cx, Handle<GlobalObject*> globa
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
RootedValue std_isConcatSpreadable(cx);
|
|
||||||
std_isConcatSpreadable.setSymbol(cx->wellKnownSymbols().get(JS::SymbolCode::isConcatSpreadable));
|
|
||||||
if (!JS_DefineProperty(cx, global, "std_isConcatSpreadable", std_isConcatSpreadable,
|
|
||||||
JSPROP_PERMANENT | JSPROP_READONLY))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define a top-level property 'std_iterator' with the name of the method
|
// Define a top-level property 'std_iterator' with the name of the method
|
||||||
// used by for-of loops to create an iterator.
|
// used by for-of loops to create an iterator.
|
||||||
RootedValue std_iterator(cx);
|
RootedValue std_iterator(cx);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче