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

Side by Side Diff: src/js/harmony-species.js

Issue 1558543002: Add a --harmony-species flag, defining @@species on constructors (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « src/heap/heap.h ('k') | src/js/prologue.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // 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
11 var 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.
15 var GlobalTypedArray = global.Uint8Array.__proto__;
16 var GlobalMap = global.Map;
17 var GlobalSet = global.Set;
18 var GlobalArrayBuffer = global.ArrayBuffer;
19 var GlobalPromise = global.Promise;
20 var GlobalRegExp = global.RegExp;
21 var speciesSymbol = utils.ImportNow("species_symbol");
22
23 function ArraySpecies() {
24 return this;
25 }
26
27 function TypedArraySpecies() {
28 return this;
29 }
30
31 function MapSpecies() {
32 return this;
33 }
34
35 function SetSpecies() {
36 return this;
37 }
38
39 function ArrayBufferSpecies() {
40 return this;
41 }
42
43 function PromiseSpecies() {
44 return this;
45 }
46
47 function RegExpSpecies() {
48 return this;
49 }
50
51 utils.InstallGetter(GlobalArray, speciesSymbol, ArraySpecies, DONT_ENUM);
52 utils.InstallGetter(GlobalTypedArray, speciesSymbol, TypedArraySpecies, DONT_ENU M);
53 utils.InstallGetter(GlobalMap, speciesSymbol, MapSpecies, DONT_ENUM);
54 utils.InstallGetter(GlobalSet, speciesSymbol, SetSpecies, DONT_ENUM);
55 utils.InstallGetter(GlobalArrayBuffer, speciesSymbol, ArrayBufferSpecies,
56 DONT_ENUM);
57 utils.InstallGetter(GlobalPromise, speciesSymbol, PromiseSpecies, DONT_ENUM);
58 utils.InstallGetter(GlobalRegExp, speciesSymbol, RegExpSpecies, DONT_ENUM);
59
60 });
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/js/prologue.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698