Merge V8 5.3.332.45. DO NOT MERGE
Test: Manual
FPIIM-449
Change-Id: Id3254828b068abdea3cb10442e0172a8c9a98e03
(cherry picked from commit 13e2dadd00298019ed862f2b2fc5068bba730bcf)
diff --git a/src/js/runtime.js b/src/js/runtime.js
index a6a0b4d..216685f 100644
--- a/src/js/runtime.js
+++ b/src/js/runtime.js
@@ -16,7 +16,6 @@
%CheckIsBootstrapping();
-var FLAG_harmony_species;
var GlobalArray = global.Array;
var GlobalBoolean = global.Boolean;
var GlobalString = global.String;
@@ -30,10 +29,6 @@
speciesSymbol = from.species_symbol;
});
-utils.ImportFromExperimental(function(from) {
- FLAG_harmony_species = from.FLAG_harmony_species;
-});
-
// ----------------------------------------------------------------------------
@@ -44,7 +39,7 @@
function ToPositiveInteger(x, rangeErrorIndex) {
- var i = TO_INTEGER_MAP_MINUS_ZERO(x);
+ var i = TO_INTEGER(x) + 0;
if (i < 0) throw MakeRangeError(rangeErrorIndex);
return i;
}
@@ -65,35 +60,22 @@
// ES2015 7.3.20
-// For the fallback with --harmony-species off, there are two possible choices:
-// - "conservative": return defaultConstructor
-// - "not conservative": return object.constructor
-// This fallback path is only needed in the transition to ES2015, and the
-// choice is made simply to preserve the previous behavior so that we don't
-// have a three-step upgrade: old behavior, unspecified intermediate behavior,
-// and ES2015.
-// In some cases, we were "conservative" (e.g., ArrayBuffer, RegExp), and in
-// other cases we were "not conservative (e.g., TypedArray, Promise).
-function SpeciesConstructor(object, defaultConstructor, conservative) {
- if (FLAG_harmony_species) {
- var constructor = object.constructor;
- if (IS_UNDEFINED(constructor)) {
- return defaultConstructor;
- }
- if (!IS_RECEIVER(constructor)) {
- throw MakeTypeError(kConstructorNotReceiver);
- }
- var species = constructor[speciesSymbol];
- if (IS_NULL_OR_UNDEFINED(species)) {
- return defaultConstructor;
- }
- if (%IsConstructor(species)) {
- return species;
- }
- throw MakeTypeError(kSpeciesNotConstructor);
- } else {
- return conservative ? defaultConstructor : object.constructor;
+function SpeciesConstructor(object, defaultConstructor) {
+ var constructor = object.constructor;
+ if (IS_UNDEFINED(constructor)) {
+ return defaultConstructor;
}
+ if (!IS_RECEIVER(constructor)) {
+ throw MakeTypeError(kConstructorNotReceiver);
+ }
+ var species = constructor[speciesSymbol];
+ if (IS_NULL_OR_UNDEFINED(species)) {
+ return defaultConstructor;
+ }
+ if (%IsConstructor(species)) {
+ return species;
+ }
+ throw MakeTypeError(kSpeciesNotConstructor);
}
//----------------------------------------------------------------------------