Issue originally made by Francisco (tolmasky)
Description
There are a number of SyntaxErrors that are thrown at the transformation phase instead of the parsing stage. A non-exhaustive (I think?) list:
- SyntaxError: unknown: super() is only allowed in a derived constructor
- SyntaxError: unknown: 'this' is not allowed before super()
- SyntaxError: unknown: missing super() call in constructor
etc.
I think moving as many syntax errors as possible to Babylon would be immensely helpful. It would allow editors to use babylon and provide inline warnings, etc (whereas currently they need to additionally run the full transformation solely to get the errors). Additionally, in AST analysis/transformations, you are kind of dealing with illegal syntax trees (in the same way that you wouldn't want super() in a normal method, only to be warned about later in transformation). Currently we run into this issue a lot, as it would be very much more time consuming to be running transformation on every keypress, and so, as we find these, we manually add the syntax checks ourselves.
Description
There are a number of SyntaxErrors that are thrown at the transformation phase instead of the parsing stage. A non-exhaustive (I think?) list:
etc.
I think moving as many syntax errors as possible to Babylon would be immensely helpful. It would allow editors to use babylon and provide inline warnings, etc (whereas currently they need to additionally run the full transformation solely to get the errors). Additionally, in AST analysis/transformations, you are kind of dealing with illegal syntax trees (in the same way that you wouldn't want super() in a normal method, only to be warned about later in transformation). Currently we run into this issue a lot, as it would be very much more time consuming to be running transformation on every keypress, and so, as we find these, we manually add the syntax checks ourselves.