Skip to content

Commit

Permalink
Revert changes from #8688
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Jul 15, 2020
1 parent 676b85c commit 3e24cef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
13 changes: 1 addition & 12 deletions src/language-js/parser-babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,7 @@ function createParse(parseMethod, ...pluginCombinations) {
babelOptions({ sourceType, extraPlugins })
)
);
} catch (_error) {
// babel@7.10.4 throws `undefined`, when parsing
// ```js
// alert(
// <!-- comment
// 'hello world'
// )
// ```
// #8688

const error = _error || { message: "Unknown error" };

} catch (error) {
throw createError(
// babel error prints (l:c) with cols that are zero indexed
// so we need our custom error
Expand Down
8 changes: 6 additions & 2 deletions tests/misc/errors/js/__snapshots__/jsfmt.spec.js.snap
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`html-like-comments.js error test 1`] = `
"Unknown error (0:0)
"Unexpected token (3:1)
1 | // Only support HTML-like comment in HTML
2 | alert(
3 | <!-- comment"
> 3 | <!-- comment
| ^
4 | 'hello world'
5 | )
6 | "
`;

exports[`module-attributes.js error test 1`] = `
Expand Down

0 comments on commit 3e24cef

Please sign in to comment.