| 1 | export interface Input { |
| 2 | name: string; |
| 3 | items: Array<{ id: number; label: string }>; |
| 4 | } |
| 5 | |
| 6 | static const message = "Hello {world} with {braces}"; |
| 7 | static const template = ` |
| 8 | This is a template literal { |
| 9 | with nested braces |
| 10 | } and expressions ${1 + 1} |
| 11 | `; |
| 12 | |
| 13 | static function evil() { |
| 14 | const obj = { a: "{", b: "}" }; |
| 15 | const regex = /\{.*\}/; |
| 16 | return `{${obj.a}${obj.b}}`; |
| 17 | } |
| 18 | |
| 19 | static { |
| 20 | console.log("Block with {braces} in string"); |
| 21 | const data = { key: "value {nested}" }; |
| 22 | } |
| 23 | |
| 24 | # Evil Braces Test |
| 25 | |
| 26 | This tests that string literals with braces don't confuse the parser. |
| 27 | |
| 28 | The message is: **${message}** |