Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/minifier): Preserve
this
of tagged template literals (#6165)
**Related issue:** - Closes #6146
- Loading branch information
Showing
6 changed files
with
40 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
let o = { | ||
f() { | ||
assert.ok(this !== o); | ||
} | ||
}; | ||
(1, o.f)``; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
let o = { | ||
f () { | ||
assert.ok(this !== o); | ||
} | ||
}; | ||
(0, o.f)``; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...inifier/tests/terser/compress/template_string/tagged_call_with_invalid_escape_2/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
console.log(({ | ||
y: ()=>String.raw | ||
}).y()`\4321\u\x`), console.log(String.raw`\4321\u\x`); | ||
}).y()`\4321\u\x`), console.log((0, String.raw)`\4321\u\x`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aec5cda
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark
es/full/minify/libraries/antd
1796779296
ns/iter (± 27690436
)1914444605
ns/iter (± 107549417
)0.94
es/full/minify/libraries/d3
371398457
ns/iter (± 11683458
)430217137
ns/iter (± 14323961
)0.86
es/full/minify/libraries/echarts
1525416613
ns/iter (± 13829625
)1582893392
ns/iter (± 73005719
)0.96
es/full/minify/libraries/jquery
99955681
ns/iter (± 3165124
)108417826
ns/iter (± 7090934
)0.92
es/full/minify/libraries/lodash
109311782
ns/iter (± 3433897
)115140595
ns/iter (± 4076471
)0.95
es/full/minify/libraries/moment
57023419
ns/iter (± 1278245
)67383821
ns/iter (± 3553303
)0.85
es/full/minify/libraries/react
20284427
ns/iter (± 752484
)28080496
ns/iter (± 17570352
)0.72
es/full/minify/libraries/terser
290868163
ns/iter (± 7579934
)327031846
ns/iter (± 7704815
)0.89
es/full/minify/libraries/three
547673794
ns/iter (± 12193168
)568710094
ns/iter (± 16681015
)0.96
es/full/minify/libraries/typescript
3354599711
ns/iter (± 11333904
)3608956218
ns/iter (± 148304921
)0.93
es/full/minify/libraries/victory
834606891
ns/iter (± 17071017
)858509768
ns/iter (± 9164333
)0.97
es/full/minify/libraries/vue
161126865
ns/iter (± 6154641
)169582844
ns/iter (± 14947793
)0.95
es/full/codegen/es3
34658
ns/iter (± 3335
)35854
ns/iter (± 2544
)0.97
es/full/codegen/es5
34903
ns/iter (± 2088
)35456
ns/iter (± 3674
)0.98
es/full/codegen/es2015
35994
ns/iter (± 3098
)34893
ns/iter (± 1385
)1.03
es/full/codegen/es2016
34550
ns/iter (± 1766
)35192
ns/iter (± 1310
)0.98
es/full/codegen/es2017
35093
ns/iter (± 2447
)35378
ns/iter (± 2322
)0.99
es/full/codegen/es2018
34783
ns/iter (± 2754
)34661
ns/iter (± 841
)1.00
es/full/codegen/es2019
33709
ns/iter (± 4616
)34990
ns/iter (± 1626
)0.96
es/full/codegen/es2020
34207
ns/iter (± 2743
)34756
ns/iter (± 1223
)0.98
es/full/all/es3
197886393
ns/iter (± 10333074
)225981851
ns/iter (± 23718760
)0.88
es/full/all/es5
204744908
ns/iter (± 24610933
)220831314
ns/iter (± 27960088
)0.93
es/full/all/es2015
152371572
ns/iter (± 10512176
)193600112
ns/iter (± 22578234
)0.79
es/full/all/es2016
148635311
ns/iter (± 9940440
)177571546
ns/iter (± 14406823
)0.84
es/full/all/es2017
144970310
ns/iter (± 6518546
)176926235
ns/iter (± 20711515
)0.82
es/full/all/es2018
141979377
ns/iter (± 5151504
)175353587
ns/iter (± 20991811
)0.81
es/full/all/es2019
140785335
ns/iter (± 4042387
)172146189
ns/iter (± 17618816
)0.82
es/full/all/es2020
135544824
ns/iter (± 4708792
)162769040
ns/iter (± 10103792
)0.83
es/full/parser
725112
ns/iter (± 59993
)752268
ns/iter (± 48247
)0.96
es/full/base/fixer
26761
ns/iter (± 1917
)26986
ns/iter (± 1786
)0.99
es/full/base/resolver_and_hygiene
93787
ns/iter (± 5869
)95519
ns/iter (± 5639
)0.98
serialization of ast node
211
ns/iter (± 26
)208
ns/iter (± 8
)1.01
serialization of serde
218
ns/iter (± 34
)229
ns/iter (± 9
)0.95
This comment was automatically generated by workflow using github-action-benchmark.