try {
var x = 1;
}
catch (e) { }
ParsingError: Expected token '(', got 'catch' in catch in try statement at line 4, col 1
Good "catch"!
The issue is in boa/src/syntax/parser/statement/try_stm/mod.rs#L67. We peek() the next token, and check if it's the catch keyword, but then, we don't consume it.
We should divide this parser into TryStatement, Catch, Finally and CatchParameter, as we can see in the spec. Then, decide if we should parse Catch or Finally depending on the peek(). Those parsers should then expect() the catch/finally keywords.
I can take this up if no one else is working.
Sure! Tell us if you need any help :+1: