-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/lexer): Fix lexing of hexadecimal escape sequences (#2838)
- Loading branch information
Showing
20 changed files
with
49 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"jsc": { | ||
"target": "es5" | ||
} | ||
} |
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 @@ | ||
console.log`\x22\x21\x224` |
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,22 @@ | ||
function _taggedTemplateLiteral(strings, raw) { | ||
if (!raw) { | ||
raw = strings.slice(0); | ||
} | ||
return Object.freeze(Object.defineProperties(strings, { | ||
raw: { | ||
value: Object.freeze(raw) | ||
} | ||
})); | ||
} | ||
function _templateObject() { | ||
var data = _taggedTemplateLiteral([ | ||
"\"!\"4" | ||
], [ | ||
"\\x22\\x21\\x224" | ||
]); | ||
_templateObject = function _templateObject() { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
console.log(_templateObject()); |
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,5 @@ | ||
{ | ||
"jsc": { | ||
"target": "es2015" | ||
} | ||
} |
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 @@ | ||
`\x22\x21\x224` |
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 @@ | ||
`\x22\x21\x224`; |
2 changes: 1 addition & 1 deletion
2
.../es6/templates/templateStringControlCharacterEscapes01/input.ts/es2015.1.normal/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 +1 @@ | ||
var x = `\0\0x00\u0000 0 00 0000`; | ||
var x = `\0\x00\u0000 0 00 0000`; |
2 changes: 1 addition & 1 deletion
2
.../templates/templateStringControlCharacterEscapes01_ES6/input.ts/es2015.1.normal/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,2 +1,2 @@ | ||
// @target: es6 | ||
var x = `\0\0x00\u0000 0 00 0000`; | ||
var x = `\0\x00\u0000 0 00 0000`; |
2 changes: 1 addition & 1 deletion
2
.../es6/templates/templateStringControlCharacterEscapes03/input.ts/es2015.1.normal/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 +1 @@ | ||
var x = `\x1f\u001f 1F 1f`; | ||
var x = `\x1F\u001f 1F 1f`; |
2 changes: 1 addition & 1 deletion
2
.../templates/templateStringControlCharacterEscapes03_ES6/input.ts/es2015.1.normal/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,2 +1,2 @@ | ||
// @target: es6 | ||
var x = `\x1f\u001f 1F 1f`; | ||
var x = `\x1F\u001f 1F 1f`; |
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
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
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
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
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
cf777c5
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
base_tr_fixer
27641
ns/iter (± 323
)23642
ns/iter (± 276
)1.17
base_tr_resolver_and_hygiene
153930
ns/iter (± 28932
)130288
ns/iter (± 24860
)1.18
codegen_es2015
61030
ns/iter (± 372
)51393
ns/iter (± 431
)1.19
codegen_es2016
61298
ns/iter (± 408
)51605
ns/iter (± 383
)1.19
codegen_es2017
61375
ns/iter (± 450
)51568
ns/iter (± 398
)1.19
codegen_es2018
61112
ns/iter (± 440
)51556
ns/iter (± 320
)1.19
codegen_es2019
60915
ns/iter (± 376
)51626
ns/iter (± 414
)1.18
codegen_es2020
61612
ns/iter (± 10449
)51585
ns/iter (± 365
)1.19
codegen_es3
61173
ns/iter (± 330
)51499
ns/iter (± 328
)1.19
codegen_es5
61345
ns/iter (± 376
)51668
ns/iter (± 377
)1.19
full_es2015
206584311
ns/iter (± 8019457
)181224590
ns/iter (± 8385947
)1.14
full_es2016
163413114
ns/iter (± 5959340
)145550053
ns/iter (± 8288243
)1.12
full_es2017
174419093
ns/iter (± 11947824
)157853695
ns/iter (± 9749004
)1.10
full_es2018
172437147
ns/iter (± 8294328
)156687310
ns/iter (± 6160645
)1.10
full_es2019
170150641
ns/iter (± 8229759
)154457376
ns/iter (± 8865541
)1.10
full_es2020
171622876
ns/iter (± 10600575
)153694169
ns/iter (± 5611120
)1.12
full_es3
246404415
ns/iter (± 16128581
)210457792
ns/iter (± 17128898
)1.17
full_es5
225233025
ns/iter (± 11944865
)197997281
ns/iter (± 12623345
)1.14
parser
758544
ns/iter (± 26780
)654591
ns/iter (± 17106
)1.16
ser_ast_node
179
ns/iter (± 9
)147
ns/iter (± 9
)1.22
ser_serde
192
ns/iter (± 5
)159
ns/iter (± 4
)1.21
emit_colors
21076733
ns/iter (± 26854946
)18576217
ns/iter (± 24517337
)1.13
emit_large
110393160
ns/iter (± 168478079
)119598771
ns/iter (± 182837125
)0.92
base_clone
2706277
ns/iter (± 249446
)2331803
ns/iter (± 399503
)1.16
fold_span
4540883
ns/iter (± 399162
)3808626
ns/iter (± 203931
)1.19
fold_span_panic
4915342
ns/iter (± 421866
)4032999
ns/iter (± 146948
)1.22
visit_mut_span
3276820
ns/iter (± 286126
)2793427
ns/iter (± 79052
)1.17
visit_mut_span_panic
3324890
ns/iter (± 197198
)3028097
ns/iter (± 246525
)1.10
ast_clone
19558
ns/iter (± 253
)16744
ns/iter (± 394
)1.17
ast_clone_to_stable
59694
ns/iter (± 483
)51250
ns/iter (± 344
)1.16
ast_clone_to_stable_then_to_unstable
108503
ns/iter (± 645
)92981
ns/iter (± 495
)1.17
json_deserialize
2319353
ns/iter (± 8069
)1932153
ns/iter (± 5292
)1.20
json_serialize
101037
ns/iter (± 413
)85263
ns/iter (± 292
)1.19
boxing_boxed
170
ns/iter (± 0
)151
ns/iter (± 2
)1.13
boxing_boxed_clone
81
ns/iter (± 0
)68
ns/iter (± 1
)1.19
boxing_unboxed
193
ns/iter (± 1
)134
ns/iter (± 0
)1.44
boxing_unboxed_clone
77
ns/iter (± 0
)63
ns/iter (± 0
)1.22
time_10
371
ns/iter (± 4
)309
ns/iter (± 3
)1.20
time_15
765
ns/iter (± 6
)665
ns/iter (± 2
)1.15
time_20
1520
ns/iter (± 8
)1259
ns/iter (± 2
)1.21
time_40
5155
ns/iter (± 21
)7169
ns/iter (± 20
)0.72
time_5
121
ns/iter (± 2
)102
ns/iter (± 1
)1.19
time_60
10200
ns/iter (± 40
)16334
ns/iter (± 68
)0.62
This comment was automatically generated by workflow using github-action-benchmark.