Skip to content

Commit 3b55fd5

Browse files
committed
fix: make rollup#1868 es5-compatible
1 parent 5800bf3 commit 3b55fd5

6 files changed

Lines changed: 42 additions & 42 deletions

File tree

packages/commonjs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ For these situations, you can change Rollup's behaviour either globally or per m
334334
var isInstance = false;
335335
try {
336336
isInstance = this instanceof a;
337-
} catch {}
337+
} catch (e) {}
338338
if (isInstance) {
339339
return Reflect.construct(f, arguments, this.constructor);
340340
}

packages/commonjs/src/helpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export function getAugmentedNamespace(n) {
4949
var isInstance = false;
5050
try {
5151
isInstance = this instanceof a;
52-
} catch {}
52+
} catch (e) {}
5353
if (isInstance) {
5454
return Reflect.construct(f, arguments, this.constructor);
5555
}

packages/commonjs/test/snapshots/function.js.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4217,7 +4217,7 @@ Generated by [AVA](https://avajs.dev).
42174217
var isInstance = false;␊
42184218
try {␊
42194219
isInstance = this instanceof a;␊
4220-
} catch {}␊
4220+
} catch (e) {}␊
42214221
if (isInstance) {␊
42224222
return Reflect.construct(f, arguments, this.constructor);␊
42234223
}␊
@@ -4319,7 +4319,7 @@ Generated by [AVA](https://avajs.dev).
43194319
var isInstance = false;␊
43204320
try {␊
43214321
isInstance = this instanceof a;␊
4322-
} catch {}␊
4322+
} catch (e) {}␊
43234323
if (isInstance) {␊
43244324
return Reflect.construct(f, arguments, this.constructor);␊
43254325
}␊
@@ -4415,7 +4415,7 @@ Generated by [AVA](https://avajs.dev).
44154415
var isInstance = false;␊
44164416
try {␊
44174417
isInstance = this instanceof a;␊
4418-
} catch {}␊
4418+
} catch (e) {}␊
44194419
if (isInstance) {␊
44204420
return Reflect.construct(f, arguments, this.constructor);␊
44214421
}␊
@@ -4555,7 +4555,7 @@ Generated by [AVA](https://avajs.dev).
45554555
var isInstance = false;␊
45564556
try {␊
45574557
isInstance = this instanceof a;␊
4558-
} catch {}␊
4558+
} catch (e) {}␊
45594559
if (isInstance) {␊
45604560
return Reflect.construct(f, arguments, this.constructor);␊
45614561
}␊
@@ -4663,7 +4663,7 @@ Generated by [AVA](https://avajs.dev).
46634663
var isInstance = false;␊
46644664
try {␊
46654665
isInstance = this instanceof a;␊
4666-
} catch {}␊
4666+
} catch (e) {}␊
46674667
if (isInstance) {␊
46684668
return Reflect.construct(f, arguments, this.constructor);␊
46694669
}␊
@@ -4736,7 +4736,7 @@ Generated by [AVA](https://avajs.dev).
47364736
var isInstance = false;␊
47374737
try {␊
47384738
isInstance = this instanceof a;␊
4739-
} catch {}␊
4739+
} catch (e) {}␊
47404740
if (isInstance) {␊
47414741
return Reflect.construct(f, arguments, this.constructor);␊
47424742
}␊
@@ -5009,7 +5009,7 @@ Generated by [AVA](https://avajs.dev).
50095009
var isInstance = false;␊
50105010
try {␊
50115011
isInstance = this instanceof a;␊
5012-
} catch {}␊
5012+
} catch (e) {}␊
50135013
if (isInstance) {␊
50145014
return Reflect.construct(f, arguments, this.constructor);␊
50155015
}␊
@@ -5302,7 +5302,7 @@ Generated by [AVA](https://avajs.dev).
53025302
var isInstance = false;␊
53035303
try {␊
53045304
isInstance = this instanceof a;␊
5305-
} catch {}␊
5305+
} catch (e) {}␊
53065306
if (isInstance) {␊
53075307
return Reflect.construct(f, arguments, this.constructor);␊
53085308
}␊
@@ -5429,7 +5429,7 @@ Generated by [AVA](https://avajs.dev).
54295429
var isInstance = false;␊
54305430
try {␊
54315431
isInstance = this instanceof a;␊
5432-
} catch {}␊
5432+
} catch (e) {}␊
54335433
if (isInstance) {␊
54345434
return Reflect.construct(f, arguments, this.constructor);␊
54355435
}␊
@@ -5663,7 +5663,7 @@ Generated by [AVA](https://avajs.dev).
56635663
var isInstance = false;␊
56645664
try {␊
56655665
isInstance = this instanceof a;␊
5666-
} catch {}␊
5666+
} catch (e) {}␊
56675667
if (isInstance) {␊
56685668
return Reflect.construct(f, arguments, this.constructor);␊
56695669
}␊
@@ -6017,7 +6017,7 @@ Generated by [AVA](https://avajs.dev).
60176017
var isInstance = false;␊
60186018
try {␊
60196019
isInstance = this instanceof a;␊
6020-
} catch {}␊
6020+
} catch (e) {}␊
60216021
if (isInstance) {␊
60226022
return Reflect.construct(f, arguments, this.constructor);␊
60236023
}␊
@@ -6136,7 +6136,7 @@ Generated by [AVA](https://avajs.dev).
61366136
var isInstance = false;␊
61376137
try {␊
61386138
isInstance = this instanceof a;␊
6139-
} catch {}␊
6139+
} catch (e) {}␊
61406140
if (isInstance) {␊
61416141
return Reflect.construct(f, arguments, this.constructor);␊
61426142
}␊
@@ -7655,7 +7655,7 @@ Generated by [AVA](https://avajs.dev).
76557655
var isInstance = false;␊
76567656
try {␊
76577657
isInstance = this instanceof a;␊
7658-
} catch {}␊
7658+
} catch (e) {}␊
76597659
if (isInstance) {␊
76607660
return Reflect.construct(f, arguments, this.constructor);␊
76617661
}␊
@@ -8405,7 +8405,7 @@ Generated by [AVA](https://avajs.dev).
84058405
var isInstance = false;␊
84068406
try {␊
84078407
isInstance = this instanceof a;␊
8408-
} catch {}␊
8408+
} catch (e) {}␊
84098409
if (isInstance) {␊
84108410
return Reflect.construct(f, arguments, this.constructor);␊
84118411
}␊
@@ -8472,7 +8472,7 @@ Generated by [AVA](https://avajs.dev).
84728472
var isInstance = false;␊
84738473
try {␊
84748474
isInstance = this instanceof a;␊
8475-
} catch {}␊
8475+
} catch (e) {}␊
84768476
if (isInstance) {␊
84778477
return Reflect.construct(f, arguments, this.constructor);␊
84788478
}␊
@@ -9870,7 +9870,7 @@ Generated by [AVA](https://avajs.dev).
98709870
var isInstance = false;␊
98719871
try {␊
98729872
isInstance = this instanceof a;␊
9873-
} catch {}␊
9873+
} catch (e) {}␊
98749874
if (isInstance) {␊
98759875
return Reflect.construct(f, arguments, this.constructor);␊
98769876
}␊
@@ -9932,7 +9932,7 @@ Generated by [AVA](https://avajs.dev).
99329932
var isInstance = false;␊
99339933
try {␊
99349934
isInstance = this instanceof a;␊
9935-
} catch {}␊
9935+
} catch (e) {}␊
99369936
if (isInstance) {␊
99379937
return Reflect.construct(f, arguments, this.constructor);␊
99389938
}␊

packages/commonjs/test/snapshots/function.js.snap

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4108,7 +4108,7 @@ function getAugmentedNamespace(n) {
41084108
var isInstance = false;
41094109
try {
41104110
isInstance = this instanceof a;
4111-
} catch {}
4111+
} catch (e) {}
41124112
if (isInstance) {
41134113
return Reflect.construct(f, arguments, this.constructor);
41144114
}
@@ -4208,7 +4208,7 @@ function getAugmentedNamespace(n) {
42084208
var isInstance = false;
42094209
try {
42104210
isInstance = this instanceof a;
4211-
} catch {}
4211+
} catch (e) {}
42124212
if (isInstance) {
42134213
return Reflect.construct(f, arguments, this.constructor);
42144214
}
@@ -4302,7 +4302,7 @@ function getAugmentedNamespace(n) {
43024302
var isInstance = false;
43034303
try {
43044304
isInstance = this instanceof a;
4305-
} catch {}
4305+
} catch (e) {}
43064306
if (isInstance) {
43074307
return Reflect.construct(f, arguments, this.constructor);
43084308
}
@@ -4436,7 +4436,7 @@ function getAugmentedNamespace(n) {
44364436
var isInstance = false;
44374437
try {
44384438
isInstance = this instanceof a;
4439-
} catch {}
4439+
} catch (e) {}
44404440
if (isInstance) {
44414441
return Reflect.construct(f, arguments, this.constructor);
44424442
}
@@ -4542,7 +4542,7 @@ function getAugmentedNamespace(n) {
45424542
var isInstance = false;
45434543
try {
45444544
isInstance = this instanceof a;
4545-
} catch {}
4545+
} catch (e) {}
45464546
if (isInstance) {
45474547
return Reflect.construct(f, arguments, this.constructor);
45484548
}
@@ -4613,7 +4613,7 @@ function getAugmentedNamespace(n) {
46134613
var isInstance = false;
46144614
try {
46154615
isInstance = this instanceof a;
4616-
} catch {}
4616+
} catch (e) {}
46174617
if (isInstance) {
46184618
return Reflect.construct(f, arguments, this.constructor);
46194619
}
@@ -4874,7 +4874,7 @@ function getAugmentedNamespace(n) {
48744874
var isInstance = false;
48754875
try {
48764876
isInstance = this instanceof a;
4877-
} catch {}
4877+
} catch (e) {}
48784878
if (isInstance) {
48794879
return Reflect.construct(f, arguments, this.constructor);
48804880
}
@@ -5159,7 +5159,7 @@ function getAugmentedNamespace(n) {
51595159
var isInstance = false;
51605160
try {
51615161
isInstance = this instanceof a;
5162-
} catch {}
5162+
} catch (e) {}
51635163
if (isInstance) {
51645164
return Reflect.construct(f, arguments, this.constructor);
51655165
}
@@ -5284,7 +5284,7 @@ function getAugmentedNamespace(n) {
52845284
var isInstance = false;
52855285
try {
52865286
isInstance = this instanceof a;
5287-
} catch {}
5287+
} catch (e) {}
52885288
if (isInstance) {
52895289
return Reflect.construct(f, arguments, this.constructor);
52905290
}
@@ -5514,7 +5514,7 @@ function getAugmentedNamespace(n) {
55145514
var isInstance = false;
55155515
try {
55165516
isInstance = this instanceof a;
5517-
} catch {}
5517+
} catch (e) {}
55185518
if (isInstance) {
55195519
return Reflect.construct(f, arguments, this.constructor);
55205520
}
@@ -5860,7 +5860,7 @@ function getAugmentedNamespace(n) {
58605860
var isInstance = false;
58615861
try {
58625862
isInstance = this instanceof a;
5863-
} catch {}
5863+
} catch (e) {}
58645864
if (isInstance) {
58655865
return Reflect.construct(f, arguments, this.constructor);
58665866
}
@@ -5977,7 +5977,7 @@ function getAugmentedNamespace(n) {
59775977
var isInstance = false;
59785978
try {
59795979
isInstance = this instanceof a;
5980-
} catch {}
5980+
} catch (e) {}
59815981
if (isInstance) {
59825982
return Reflect.construct(f, arguments, this.constructor);
59835983
}
@@ -7422,7 +7422,7 @@ function getAugmentedNamespace(n) {
74227422
var isInstance = false;
74237423
try {
74247424
isInstance = this instanceof a;
7425-
} catch {}
7425+
} catch (e) {}
74267426
if (isInstance) {
74277427
return Reflect.construct(f, arguments, this.constructor);
74287428
}
@@ -8144,7 +8144,7 @@ function getAugmentedNamespace(n) {
81448144
var isInstance = false;
81458145
try {
81468146
isInstance = this instanceof a;
8147-
} catch {}
8147+
} catch (e) {}
81488148
if (isInstance) {
81498149
return Reflect.construct(f, arguments, this.constructor);
81508150
}
@@ -8209,7 +8209,7 @@ function getAugmentedNamespace(n) {
82098209
var isInstance = false;
82108210
try {
82118211
isInstance = this instanceof a;
8212-
} catch {}
8212+
} catch (e) {}
82138213
if (isInstance) {
82148214
return Reflect.construct(f, arguments, this.constructor);
82158215
}
@@ -9547,7 +9547,7 @@ function getAugmentedNamespace(n) {
95479547
var isInstance = false;
95489548
try {
95499549
isInstance = this instanceof a;
9550-
} catch {}
9550+
} catch (e) {}
95519551
if (isInstance) {
95529552
return Reflect.construct(f, arguments, this.constructor);
95539553
}
@@ -9607,7 +9607,7 @@ function getAugmentedNamespace(n) {
96079607
var isInstance = false;
96089608
try {
96099609
isInstance = this instanceof a;
9610-
} catch {}
9610+
} catch (e) {}
96119611
if (isInstance) {
96129612
return Reflect.construct(f, arguments, this.constructor);
96139613
}

packages/commonjs/test/snapshots/test.js.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Generated by [AVA](https://avajs.dev).
5050
var isInstance = false;␊
5151
try {␊
5252
isInstance = this instanceof a;␊
53-
} catch {}␊
53+
} catch (e) {}␊
5454
if (isInstance) {␊
5555
return Reflect.construct(f, arguments, this.constructor);␊
5656
}␊
@@ -263,7 +263,7 @@ Generated by [AVA](https://avajs.dev).
263263
var isInstance = false;␊
264264
try {␊
265265
isInstance = this instanceof a;␊
266-
} catch {}␊
266+
} catch (e) {}␊
267267
if (isInstance) {␊
268268
return Reflect.construct(f, arguments, this.constructor);␊
269269
}␊
@@ -393,7 +393,7 @@ Generated by [AVA](https://avajs.dev).
393393
var isInstance = false;␊
394394
try {␊
395395
isInstance = this instanceof a;␊
396-
} catch {}␊
396+
} catch (e) {}␊
397397
if (isInstance) {␊
398398
return Reflect.construct(f, arguments, this.constructor);␊
399399
}␊

packages/commonjs/test/snapshots/test.js.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function getAugmentedNamespace(n) {
140140
var isInstance = false;
141141
try {
142142
isInstance = this instanceof a;
143-
} catch {}
143+
} catch (e) {}
144144
if (isInstance) {
145145
return Reflect.construct(f, arguments, this.constructor);
146146
}
@@ -268,7 +268,7 @@ function getAugmentedNamespace(n) {
268268
var isInstance = false;
269269
try {
270270
isInstance = this instanceof a;
271-
} catch {}
271+
} catch (e) {}
272272
if (isInstance) {
273273
return Reflect.construct(f, arguments, this.constructor);
274274
}
@@ -438,7 +438,7 @@ function getAugmentedNamespace(n) {
438438
var isInstance = false;
439439
try {
440440
isInstance = this instanceof a;
441-
} catch {}
441+
} catch (e) {}
442442
if (isInstance) {
443443
return Reflect.construct(f, arguments, this.constructor);
444444
}

0 commit comments

Comments
 (0)