-
Notifications
You must be signed in to change notification settings - Fork 0
/
es6-shim-tests.ts
222 lines (219 loc) · 8.92 KB
/
es6-shim-tests.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
/// <reference path="es6-shim.d.ts" />
interface Point { x: number; y: number; }
interface Point3D extends Point { z: number; }
let a: any;
let s: string;
let i: number;
let b: boolean;
let f: () => void;
let o: Object;
let r: RegExp;
let sym: symbol;
let e: Error;
let date: Date;
let key: PropertyKey;
let point: Point;
let point3d: Point3D;
let arrayOfPoint: Point[];
let arrayOfPoint3D: Point3D[];
let arrayOfSymbol: symbol[];
let arrayOfPropertyKey: PropertyKey[];
let arrayOfAny: any[];
let arrayOfStringAny: [string, any][];
let arrayLikeOfAny: ArrayLike<any>;
let iterableOfPoint: IterableShim<Point>;
let iterableOfStringPoint: IterableShim<[string, Point]>;
let iterableOfPointPoint3D: IterableShim<[Point, Point3D]>;
let iterableIteratorOfPoint: IterableIteratorShim<Point>;
let iterableIteratorOfNumberPoint: IterableIteratorShim<[number, Point]>;
let iterableIteratorOfNumber: IterableIteratorShim<number>;
let iterableIteratorOfString: IterableIteratorShim<string>;
let iterableIteratorOfPointPoint: IterableIteratorShim<[Point, Point]>;
let iterableIteratorOfNode: IterableIteratorShim<Node>;
let iterableIteratorOfStringPoint: IterableIteratorShim<[string, Point]>;
let iterableIteratorOfAny: IterableIteratorShim<any>;
let iterableIteratorOfPropertyKey: IterableIteratorShim<PropertyKey>;
let iterableIteratorOfPropertyKeyPoint: IterableIteratorShim<[PropertyKey, Point]>;
let nodeList: NodeList;
let pd: PropertyDescriptor;
let pdm: PropertyDescriptorMap;
let map: Map<string, Point>;
let set: Set<Point>;
let weakMap: WeakMap<Point, Point3D>;
let weakSet: WeakSet<Point>;
let promiseLikeOfPoint: PromiseLike<Point>;
let promiseLikeOfPoint3D: PromiseLike<Point3D>;
let promiseOfPoint: Promise<Point>;
let promiseOfPoint3D: Promise<Point3D>;
let promiseOfArrayOfPoint: Promise<Point[]>;
let promiseOfVoid: Promise<void>;
point = Object.assign(point, point);
b = Object.is(point, point);
Object.setPrototypeOf(point, point);
point = arrayOfPoint.find(p => b);
i = arrayOfPoint.findIndex(p => b);
arrayOfPoint = arrayOfPoint.fill(point, i, arrayOfPoint.length);
arrayOfPoint = arrayOfPoint.copyWithin(i, i, i);
arrayOfPoint = Array.from(arrayOfPoint);
arrayOfPoint = Array.from(iterableOfPoint);
arrayOfPoint3D = Array.from(arrayOfPoint, point => point3d);
arrayOfPoint3D = Array.from(arrayOfPoint, point => point3d, a);
arrayOfPoint3D = Array.from(iterableOfPoint, point => point3d);
arrayOfPoint3D = Array.from(iterableOfPoint, point => point3d, a);
arrayOfPoint = Array.of(point, point);
i = s.codePointAt(i);
b = s.includes(s, i);
b = s.endsWith(s, i);
s = s.repeat(i);
b = s.startsWith(s, i);
s = String.fromCodePoint(i, i);
s = String.raw`abc`;
s = r.flags;
i = Number.EPSILON;
b = Number.isFinite(i);
b = Number.isInteger(i);
b = Number.isNaN(i);
b = Number.isSafeInteger(i);
i = Number.MAX_SAFE_INTEGER;
i = Number.MIN_SAFE_INTEGER;
i = Number.parseFloat(s);
i = Number.parseInt(s);
i = Number.parseInt(s, i);
i = Math.clz32(i);
i = Math.imul(i, i);
i = Math.sign(i);
i = Math.log10(i);
i = Math.log2(i);
i = Math.log1p(i);
i = Math.expm1(i);
i = Math.cosh(i);
i = Math.sinh(i);
i = Math.tanh(i);
i = Math.acosh(i);
i = Math.asinh(i);
i = Math.atanh(i);
i = Math.hypot(i, i);
i = Math.trunc(i);
i = Math.fround(i);
i = Math.cbrt(i);
map.clear();
map.delete(s);
map.forEach((value: Point, key: string) => { });
point = map.get(s);
b = map.has(s);
map = map.set(s, point);
i = map.size;
map = new Map<string, Point>();
map = new Map(iterableOfStringPoint);
set.clear();
set.delete(point);
set.forEach((value: Point, key: Point) => { });
b = set.has(point);
set = set.add(point);
i = set.size;
set = new Set<Point>();
set = new Set(iterableOfPoint);
weakMap.delete(point);
point3d = weakMap.get(point);
b = weakMap.has(point);
weakMap = weakMap.set(point, point3d);
weakMap = new WeakMap<Point, Point3D>();
weakMap = new WeakMap(iterableOfPointPoint3D);
weakSet.delete(point);
weakSet = weakSet.add(point);
b = weakSet.has(point);
weakSet = new WeakSet<Point>();
weakSet = new WeakSet(iterableOfPoint);
iterableIteratorOfNumberPoint = arrayOfPoint.entries();
iterableIteratorOfNumber = arrayOfPoint.keys();
iterableIteratorOfPoint = arrayOfPoint.values();
iterableIteratorOfPointPoint = set.entries();
iterableIteratorOfPoint = set.keys();
iterableIteratorOfPoint = set.values();
promiseLikeOfPoint.then((point: Point) => { });
promiseLikeOfPoint = promiseLikeOfPoint.then();
promiseLikeOfPoint = promiseLikeOfPoint.then(p => point);
promiseLikeOfPoint = promiseLikeOfPoint.then(p => promiseLikeOfPoint);
promiseLikeOfPoint = promiseLikeOfPoint.then(p => point, e => point);
promiseLikeOfPoint = promiseLikeOfPoint.then(p => promiseLikeOfPoint, e => point);
promiseLikeOfPoint = promiseLikeOfPoint.then(p => point, e => promiseLikeOfPoint);
promiseLikeOfPoint = promiseLikeOfPoint.then(p => point, e => { });
promiseLikeOfPoint = promiseLikeOfPoint.then(p => promiseLikeOfPoint, e => { });
promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => point3d);
promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => promiseLikeOfPoint3D);
promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => point3d, e => point3d);
promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => promiseLikeOfPoint3D, e => point3d);
promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => point3d, e => promiseLikeOfPoint3D);
promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => point3d, e => { });
promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => promiseLikeOfPoint3D, e => { });
promiseOfPoint.then((point: Point) => { });
promiseOfPoint = promiseOfPoint.then();
promiseOfPoint = promiseOfPoint.then(p => point);
promiseOfPoint = promiseOfPoint.then(p => promiseOfPoint);
promiseOfPoint = promiseOfPoint.then(p => promiseLikeOfPoint);
promiseOfPoint = promiseOfPoint.then(p => point, e => point);
promiseOfPoint = promiseOfPoint.then(p => promiseOfPoint, e => point);
promiseOfPoint = promiseOfPoint.then(p => promiseLikeOfPoint, e => point);
promiseOfPoint = promiseOfPoint.then(p => point, e => promiseOfPoint);
promiseOfPoint = promiseOfPoint.then(p => point, e => promiseLikeOfPoint);
promiseOfPoint = promiseOfPoint.then(p => point, e => { });
promiseOfPoint = promiseOfPoint.then(p => promiseOfPoint, e => { });
promiseOfPoint = promiseOfPoint.then(p => promiseLikeOfPoint, e => { });
promiseOfPoint3D = promiseOfPoint.then(p => point3d);
promiseOfPoint3D = promiseOfPoint.then(p => promiseOfPoint3D);
promiseOfPoint3D = promiseOfPoint.then(p => promiseLikeOfPoint3D);
promiseOfPoint3D = promiseOfPoint.then(p => point3d, e => point3d);
promiseOfPoint3D = promiseOfPoint.then(p => promiseOfPoint3D, e => point3d);
promiseOfPoint3D = promiseOfPoint.then(p => promiseLikeOfPoint3D, e => point3d);
promiseOfPoint3D = promiseOfPoint.then(p => point3d, e => promiseOfPoint3D);
promiseOfPoint3D = promiseOfPoint.then(p => point3d, e => promiseLikeOfPoint3D);
promiseOfPoint3D = promiseOfPoint.then(p => point3d, e => { });
promiseOfPoint3D = promiseOfPoint.then(p => promiseOfPoint3D, e => { });
promiseOfPoint3D = promiseOfPoint.then(p => promiseLikeOfPoint3D, e => { });
promiseOfPoint = promiseOfPoint.catch(e => point);
promiseOfPoint = promiseOfPoint.catch(e => promiseOfPoint);
promiseOfPoint = promiseOfPoint.catch(e => promiseLikeOfPoint);
promiseOfPoint = promiseOfPoint.catch(e => { });
promiseOfPoint3D = promiseOfPoint.catch(e => point3d);
promiseOfPoint3D = promiseOfPoint.catch(e => promiseOfPoint3D);
promiseOfPoint3D = promiseOfPoint.catch(e => promiseLikeOfPoint3D);
promiseOfPoint = new Promise<Point>((resolve, reject) => resolve(point));
promiseOfPoint = new Promise<Point>((resolve, reject) => resolve(promiseOfPoint));
promiseOfPoint = new Promise<Point>((resolve, reject) => resolve(promiseLikeOfPoint));
promiseOfPoint = new Promise<Point>((resolve, reject) => reject(e));
promiseOfArrayOfPoint = Promise.all(arrayOfPoint);
promiseOfArrayOfPoint = Promise.all(iterableOfPoint);
promiseOfPoint = Promise.race(arrayOfPoint);
promiseOfPoint = Promise.race(iterableOfPoint);
promiseOfVoid = Promise.resolve();
promiseOfPoint = Promise.resolve(point3d);
promiseOfPoint = Promise.resolve(promiseOfPoint);
promiseOfPoint = Promise.resolve(promiseLikeOfPoint);
promiseOfVoid = Promise.reject(e);
promiseOfPoint = Promise.reject<Point>(e);
a = Reflect.apply(f, a, arrayLikeOfAny);
a = Reflect.construct(f, arrayLikeOfAny);
b = Reflect.defineProperty(a, s, pd);
b = Reflect.defineProperty(a, i, pd);
b = Reflect.defineProperty(a, sym, pd);
b = Reflect.deleteProperty(a, s);
b = Reflect.deleteProperty(a, i);
b = Reflect.deleteProperty(a, sym);
iterableIteratorOfAny = Reflect.enumerate(a);
a = Reflect.get(a, s, a);
a = Reflect.get(a, i, a);
a = Reflect.get(a, sym, a);
pd = Reflect.getOwnPropertyDescriptor(a, s);
pd = Reflect.getOwnPropertyDescriptor(a, i);
pd = Reflect.getOwnPropertyDescriptor(a, sym);
a = Reflect.getPrototypeOf(a);
b = Reflect.has(a, s);
b = Reflect.has(a, i);
b = Reflect.has(a, sym);
b = Reflect.isExtensible(a);
arrayOfPropertyKey = Reflect.ownKeys(a);
b = Reflect.preventExtensions(a);
b = Reflect.set(a, s, a, a);
b = Reflect.set(a, i, a, a);
b = Reflect.set(a, sym, a, a);
b = Reflect.setPrototypeOf(a, a);