Index: src/js/array.js |
diff --git a/src/js/array.js b/src/js/array.js |
index 355f9962b63a3cab5ae5d2088dfad0fa06b891ad..c29b8f7256ad1d2c568f5a5103d4c666f4aaf485 100644 |
--- a/src/js/array.js |
+++ b/src/js/array.js |
@@ -11,7 +11,6 @@ |
// ------------------------------------------------------------------- |
// Imports |
-var FLAG_harmony_species; |
var GetIterator; |
var GetMethod; |
var GlobalArray = global.Array; |
@@ -23,6 +22,7 @@ var MinSimple; |
var ObjectHasOwnProperty; |
var ObjectToString = utils.ImportNow("object_to_string"); |
var iteratorSymbol = utils.ImportNow("iterator_symbol"); |
+var speciesSymbol = utils.ImportNow("species_symbol"); |
var unscopablesSymbol = utils.ImportNow("unscopables_symbol"); |
utils.Import(function(from) { |
@@ -34,23 +34,12 @@ utils.Import(function(from) { |
ObjectHasOwnProperty = from.ObjectHasOwnProperty; |
}); |
-utils.ImportFromExperimental(function(from) { |
- FLAG_harmony_species = from.FLAG_harmony_species; |
-}); |
- |
// ------------------------------------------------------------------- |
function ArraySpeciesCreate(array, length) { |
- var constructor; |
- |
length = INVERT_NEG_ZERO(length); |
- |
- if (FLAG_harmony_species) { |
- constructor = %ArraySpeciesConstructor(array); |
- } else { |
- constructor = GlobalArray; |
- } |
+ var constructor = %ArraySpeciesConstructor(array); |
return new constructor(length); |
} |
@@ -1642,6 +1631,12 @@ function ArrayOf(...args) { |
return array; |
} |
+ |
+function ArraySpecies() { |
+ return this; |
+} |
+ |
+ |
// ------------------------------------------------------------------- |
// Set up non-enumerable constructor property on the Array.prototype |
@@ -1717,6 +1712,8 @@ utils.InstallFunctions(GlobalArray.prototype, DONT_ENUM, [ |
"includes", getFunction("includes", ArrayIncludes, 1), |
]); |
+utils.InstallGetter(GlobalArray, speciesSymbol, ArraySpecies); |
+ |
%FinishArrayPrototypeSetup(GlobalArray.prototype); |
// The internal Array prototype doesn't need to be fancy, since it's never |