File: parse_errors.js

package info (click to toggle)
node-terser 5.38.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,156 kB
  • sloc: javascript: 99,692; makefile: 52; perl: 48; sh: 13
file content (23 lines) | stat: -rw-r--r-- 439 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
basic_syntax_error: {
    bad_input: `
        var x = 5--;
    `
    expect_error: ({
        name: "SyntaxError",
        message: "Invalid use of -- operator",
        line: 2,
        col: 17,
    })
}

invalid_template_string_example: {
    bad_input: `
        console.log(\`foo \${100 + 23}
    `
    expect_error: ({
        name: "SyntaxError",
        message: "Unterminated template",
        line: 2,
        col: 35,
    })
}