Chromium Code Reviews| Index: src/js/runtime.js |
| diff --git a/src/js/runtime.js b/src/js/runtime.js |
| index 23c329651a3e47b5f3ab85ebe20e6b28a96b1cd6..3512649b34150fac61869eb081d7ed939c22afee 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 @@ utils.Import(function(from) { |
| speciesSymbol = from.species_symbol; |
| }); |
| -utils.ImportFromExperimental(function(from) { |
| - FLAG_harmony_species = from.FLAG_harmony_species; |
| -}); |
| - |
| // ---------------------------------------------------------------------------- |
| @@ -65,35 +60,22 @@ function MinSimple(a, b) { |
| // 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) { |
|
Dan Ehrenberg
2016/06/23 23:53:52
This function should not take the 'conservative' f
adamk
2016/06/24 00:08:27
Done.
|
| - 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; |
| + 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); |
| } |
| //---------------------------------------------------------------------------- |