blob: 426ac466e742fbceff9f78ce23531d5bc6102cea [file] [log] [blame]
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001// Copyright 2015 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5(function(global, utils, extrasUtils) {
6
7"use strict";
8
9%CheckIsBootstrapping();
10
11var GlobalArray = global.Array;
12// It is important that this file is run after src/js/typedarray.js,
13// otherwise GlobalTypedArray would be Object, and we would break
14// old versions of Zepto.
15var GlobalTypedArray = global.Uint8Array.__proto__;
16var GlobalMap = global.Map;
17var GlobalSet = global.Set;
18var GlobalArrayBuffer = global.ArrayBuffer;
19var GlobalPromise = global.Promise;
20var GlobalRegExp = global.RegExp;
21var speciesSymbol = utils.ImportNow("species_symbol");
22
23function ArraySpecies() {
24 return this;
25}
26
27function TypedArraySpecies() {
28 return this;
29}
30
31function MapSpecies() {
32 return this;
33}
34
35function SetSpecies() {
36 return this;
37}
38
39function ArrayBufferSpecies() {
40 return this;
41}
42
43function PromiseSpecies() {
44 return this;
45}
46
47function RegExpSpecies() {
48 return this;
49}
50
51utils.InstallGetter(GlobalArray, speciesSymbol, ArraySpecies, DONT_ENUM);
52utils.InstallGetter(GlobalTypedArray, speciesSymbol, TypedArraySpecies, DONT_ENUM);
53utils.InstallGetter(GlobalMap, speciesSymbol, MapSpecies, DONT_ENUM);
54utils.InstallGetter(GlobalSet, speciesSymbol, SetSpecies, DONT_ENUM);
55utils.InstallGetter(GlobalArrayBuffer, speciesSymbol, ArrayBufferSpecies,
56 DONT_ENUM);
57utils.InstallGetter(GlobalPromise, speciesSymbol, PromiseSpecies, DONT_ENUM);
58utils.InstallGetter(GlobalRegExp, speciesSymbol, RegExpSpecies, DONT_ENUM);
59
60});