File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
crates/swc_ecma_minifier/tests/fixture/issues/10936 Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change 1
1
const variable = { } ;
2
2
console . log ( "OrderNumber=" + variable . data ?. orderNumber + "|AuditNo=" + variable . data ?. auditNo + "|JournalType=" + transactionTypeCode [ variable . data . transactionType ] + "|IsPreview=0" ) ;
3
- variable ?. notExist ;
4
- variable . data ?. value ;
5
- obj ?. a ?. b ?. c ;
3
+ // Additional test cases
4
+ export const test1 = "12" ;
5
+ export const test2 = "12" ;
6
+ export const test3 = "1" + variable ?. notExist + "2" ;
7
+ export const test4 = "1" + variable . data ?. value + "2" ;
8
+ export const test5 = "1" + obj ?. a ?. b ?. c + "2" ;
6
9
// Function calls can return null/undefined
7
- someFunction ( ) ;
8
- obj . method ( ) ;
10
+ export const test6 = "1" + someFunction ( ) + "2" ;
11
+ export const test7 = "1" + obj . method ( ) + "2" ;
9
12
// Identifiers can be null/undefined
10
- unknownVar ;
13
+ export const test8 = "1" + unknownVar + "2" ;
11
14
// Other expressions that can be null/undefined
12
- condition ;
13
- await promise ;
14
- new Constructor ( ) ;
15
+ export const test9 = "1" + ( condition ? null : 'x' ) + "2" ;
16
+ export const test10 = "1" + await promise + "2" ;
17
+ export const test11 = "1" + new Constructor ( ) + "2" ;
You can’t perform that action at this time.
0 commit comments