Skip to content

Commit

Permalink
Better catch SyntaxError when babel returns wrong error type
Browse files Browse the repository at this point in the history
for some reason Babel does not return SyntaxError in some cases where it
should. In a lot of those cases goja is *correctly* catching the syntax
error but we then proceed to try to run the code through babel.

This might be better of knowing that it expects a SyntaxError, but given
that this won't be what the end user gets (or any error) I went with
requiring that both babel and goja error out and overwrite babel type in
case both reported an error.
  • Loading branch information
mstoykov committed Jun 15, 2021
1 parent cf9b9aa commit 7daba1f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 103 deletions.
Loading

0 comments on commit 7daba1f

Please sign in to comment.