Commit 6a7f7a9 1 parent ec83450 commit 6a7f7a9 Copy full SHA for 6a7f7a9
File tree 3 files changed +77
-8
lines changed
babel-helper-define-polyfill-provider/src/visitors
babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/dead-branch
3 files changed +77
-8
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,8 @@ export default (
13
13
14
14
const polyfilled = new WeakSet ( ) ;
15
15
function maybeMark ( path : NodePath , oldNode : t . Node ) {
16
- if ( path . node !== oldNode ) {
16
+ // Avoid Instance Properties
17
+ if ( path . node !== oldNode && ! path . isCallExpression ( ) ) {
17
18
polyfilled . add ( path . node ) ;
18
19
}
19
20
}
Original file line number Diff line number Diff line change 1
- String . prototype . padStart || err ;
2
- ! String . prototype . padStart || ok ;
1
+ Reflect . construct || err ;
2
+ ! Reflect . construct || ok ;
3
3
4
4
5
- String . prototype . padStart ? ok : err ;
6
- ! String . prototype . padStart ? err : ok ;
5
+ Reflect . construct ? ok : err ;
6
+ ! Reflect . construct ? err : ok ;
7
7
8
- if ( String . prototype . padStart ) {
8
+ if ( Reflect . construct ) {
9
9
ok ;
10
10
} else {
11
11
err ;
12
12
}
13
- if ( ! String . prototype . padStart ) {
13
+ if ( ! Reflect . construct ) {
14
+ err ;
15
+ } else {
16
+ ok ;
17
+ }
18
+
19
+
20
+ Symbol . dispose || err ;
21
+ ! Symbol . dispose || ok ;
22
+
23
+
24
+ Symbol . dispose ? ok : err ;
25
+ ! Symbol . dispose ? err : ok ;
26
+
27
+ if ( Symbol . dispose ) {
28
+ ok ;
29
+ } else {
30
+ err ;
31
+ }
32
+ if ( ! Symbol . dispose ) {
33
+ err ;
34
+ } else {
35
+ ok ;
36
+ }
37
+
38
+
39
+ a . padStart || err ;
40
+ ! a . padStart || ok ;
41
+
42
+
43
+ a . padStart ? ok : err ;
44
+ ! a . padStart ? err : ok ;
45
+
46
+ if ( a . padStart ) {
47
+ ok ;
48
+ } else {
49
+ err ;
50
+ }
51
+ if ( ! a . padStart ) {
14
52
err ;
15
53
} else {
16
54
ok ;
Original file line number Diff line number Diff line change
1
+ import _Reflect$construct from "core-js-pure/stable/reflect/construct.js" ;
2
+ import _Symbol from "core-js-pure/stable/symbol/index.js" ;
1
3
import _padStartInstanceProperty from "core-js-pure/stable/instance/pad-start.js" ;
2
- _padStartInstanceProperty ( String . prototype ) ;
4
+ _Reflect$construct ;
3
5
ok ;
4
6
ok ;
5
7
ok ;
9
11
{
10
12
ok ;
11
13
}
14
+ _Symbol . dispose || err ;
15
+ ! _Symbol . dispose || ok ;
16
+ _Symbol . dispose ? ok : err ;
17
+ ! _Symbol . dispose ? err : ok ;
18
+ if ( _Symbol . dispose ) {
19
+ ok ;
20
+ } else {
21
+ err ;
22
+ }
23
+ if ( ! _Symbol . dispose ) {
24
+ err ;
25
+ } else {
26
+ ok ;
27
+ }
28
+ _padStartInstanceProperty ( a ) || err ;
29
+ ! _padStartInstanceProperty ( a ) || ok ;
30
+ _padStartInstanceProperty ( a ) ? ok : err ;
31
+ ! _padStartInstanceProperty ( a ) ? err : ok ;
32
+ if ( _padStartInstanceProperty ( a ) ) {
33
+ ok ;
34
+ } else {
35
+ err ;
36
+ }
37
+ if ( ! _padStartInstanceProperty ( a ) ) {
38
+ err ;
39
+ } else {
40
+ ok ;
41
+ }
You can’t perform that action at this time.
0 commit comments