-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix parsing of parenthesized functions in conditional expressions (#4…
- Loading branch information
1 parent
0f3d0e0
commit cdf12f9
Showing
5 changed files
with
33 additions
and
1 deletion.
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
8 changes: 8 additions & 0 deletions
8
tests/baselines/reference/parserParenthesizedVariableAndParenthesizedFunctionInTernary.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//// [parserParenthesizedVariableAndParenthesizedFunctionInTernary.ts] | ||
let a: any; | ||
const c = true ? (a) : (function() {}); | ||
|
||
|
||
//// [parserParenthesizedVariableAndParenthesizedFunctionInTernary.js] | ||
var a; | ||
var c = true ? (a) : (function () { }); |
8 changes: 8 additions & 0 deletions
8
.../baselines/reference/parserParenthesizedVariableAndParenthesizedFunctionInTernary.symbols
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,8 @@ | ||
=== tests/cases/conformance/parser/ecmascript5/parserParenthesizedVariableAndParenthesizedFunctionInTernary.ts === | ||
let a: any; | ||
>a : Symbol(a, Decl(parserParenthesizedVariableAndParenthesizedFunctionInTernary.ts, 0, 3)) | ||
|
||
const c = true ? (a) : (function() {}); | ||
>c : Symbol(c, Decl(parserParenthesizedVariableAndParenthesizedFunctionInTernary.ts, 1, 5)) | ||
>a : Symbol(a, Decl(parserParenthesizedVariableAndParenthesizedFunctionInTernary.ts, 0, 3)) | ||
|
13 changes: 13 additions & 0 deletions
13
tests/baselines/reference/parserParenthesizedVariableAndParenthesizedFunctionInTernary.types
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,13 @@ | ||
=== tests/cases/conformance/parser/ecmascript5/parserParenthesizedVariableAndParenthesizedFunctionInTernary.ts === | ||
let a: any; | ||
>a : any | ||
|
||
const c = true ? (a) : (function() {}); | ||
>c : any | ||
>true ? (a) : (function() {}) : any | ||
>true : true | ||
>(a) : any | ||
>a : any | ||
>(function() {}) : () => void | ||
>function() {} : () => void | ||
|
2 changes: 2 additions & 0 deletions
2
...rmance/parser/ecmascript5/parserParenthesizedVariableAndParenthesizedFunctionInTernary.ts
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,2 @@ | ||
let a: any; | ||
const c = true ? (a) : (function() {}); |