Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Unified Diff: src/js/array.js

Issue 2096933002: Remove all harmony runtime flags which shipped in M51 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review comments Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/isolate-inl.h ('k') | src/js/arraybuffer.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/isolate-inl.h ('k') | src/js/arraybuffer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698