File tree 7 files changed +112
-7
lines changed
swc/tests/fixture/issues-8xxx/8482
7 files changed +112
-7
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "jsc" : {
3
+ "parser" : {
4
+ "syntax" : " ecmascript" ,
5
+ "jsx" : false
6
+ },
7
+ "externalHelpers" : true ,
8
+ "minify" : {
9
+ "compress" : false ,
10
+ "mangle" : false
11
+ },
12
+ "keepClassNames" : true ,
13
+ "loose" : true
14
+ },
15
+ "minify" : false ,
16
+ "isModule" : true ,
17
+ "module" : {
18
+ "type" : " umd"
19
+ },
20
+ "env" : {
21
+ "targets" : " " ,
22
+ "bugfixes" : true
23
+ }
24
+ }
Original file line number Diff line number Diff line change
1
+ export let a = ''
Original file line number Diff line number Diff line change
1
+ ( function ( global , factory ) {
2
+ if ( typeof module === "object" && typeof module . exports === "object" ) factory ( exports ) ;
3
+ else if ( typeof define === "function" && define . amd ) define ( [
4
+ "exports"
5
+ ] , factory ) ;
6
+ else if ( global = typeof globalThis !== "undefined" ? globalThis : global || self ) factory ( global . index = { } ) ;
7
+ } ) ( this , function ( exports ) {
8
+ "use strict" ;
9
+ Object . defineProperty ( exports , "__esModule" , {
10
+ value : true
11
+ } ) ;
12
+ Object . defineProperty ( exports , "a" , {
13
+ enumerable : true ,
14
+ get : function ( ) {
15
+ return a ;
16
+ }
17
+ } ) ;
18
+ let a = "" ;
19
+ } ) ;
Original file line number Diff line number Diff line change @@ -824,12 +824,16 @@ impl<'a> Lexer<'a> {
824
824
// Optimization
825
825
{
826
826
let s = l. input . uncons_while ( |c| {
827
+ if !c. is_ident_part ( ) {
828
+ return false ;
829
+ }
830
+
827
831
// Performance optimization
828
832
if c. is_ascii_uppercase ( ) || c. is_ascii_digit ( ) || !c. is_ascii ( ) {
829
833
can_be_keyword = false ;
830
834
}
831
835
832
- c . is_ident_part ( )
836
+ true
833
837
} ) ;
834
838
if !s. is_empty ( ) {
835
839
first = false ;
Original file line number Diff line number Diff line change @@ -153,12 +153,7 @@ const L_I: ByteHandler = Some(|lexer| {
153
153
} )
154
154
} ) ;
155
155
156
- const L_J : ByteHandler = Some ( |lexer| {
157
- lexer. read_word_with ( |s| match s {
158
- "let" => Some ( Word :: Keyword ( Keyword :: Let ) ) ,
159
- _ => None ,
160
- } )
161
- } ) ;
156
+ const L_J : ByteHandler = IDN ;
162
157
163
158
const L_K : ByteHandler = Some ( |lexer| {
164
159
lexer. read_word_with ( |s| match s {
Original file line number Diff line number Diff line change
1
+ export let a = ''
Original file line number Diff line number Diff line change
1
+ {
2
+ "type" : " Module" ,
3
+ "span" : {
4
+ "start" : 1 ,
5
+ "end" : 19 ,
6
+ "ctxt" : 0
7
+ },
8
+ "body" : [
9
+ {
10
+ "type" : " ExportDeclaration" ,
11
+ "span" : {
12
+ "start" : 1 ,
13
+ "end" : 19 ,
14
+ "ctxt" : 0
15
+ },
16
+ "declaration" : {
17
+ "type" : " VariableDeclaration" ,
18
+ "span" : {
19
+ "start" : 8 ,
20
+ "end" : 19 ,
21
+ "ctxt" : 0
22
+ },
23
+ "kind" : " let" ,
24
+ "declare" : false ,
25
+ "declarations" : [
26
+ {
27
+ "type" : " VariableDeclarator" ,
28
+ "span" : {
29
+ "start" : 13 ,
30
+ "end" : 19 ,
31
+ "ctxt" : 0
32
+ },
33
+ "id" : {
34
+ "type" : " Identifier" ,
35
+ "span" : {
36
+ "start" : 13 ,
37
+ "end" : 14 ,
38
+ "ctxt" : 0
39
+ },
40
+ "value" : " a" ,
41
+ "optional" : false ,
42
+ "typeAnnotation" : null
43
+ },
44
+ "init" : {
45
+ "type" : " StringLiteral" ,
46
+ "span" : {
47
+ "start" : 17 ,
48
+ "end" : 19 ,
49
+ "ctxt" : 0
50
+ },
51
+ "value" : " " ,
52
+ "raw" : " ''"
53
+ },
54
+ "definite" : false
55
+ }
56
+ ]
57
+ }
58
+ }
59
+ ],
60
+ "interpreter" : null
61
+ }
You can’t perform that action at this time.
0 commit comments