From 35ac6f07526ad2361fa2e6d017ff5bd0c396d4d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Jul 2020 08:02:36 +0800 Subject: [PATCH] Build(deps): Bump @babel/parser from 7.10.3 to 7.10.4 (#8688) * Build(deps): Bump @babel/parser from 7.10.3 to 7.10.4 Bumps [@babel/parser](https://github.com/babel/babel/tree/HEAD/packages/babel-parser) from 7.10.3 to 7.10.4. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.10.4/packages/babel-parser) Signed-off-by: dependabot[bot] * Add `delete obj?.#x.a` test * Add new `tuple` and `record` tests. Fix old test * Fix test Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: fisker --- package.json | 2 +- src/language-js/parser-babel.js | 13 ++++++- .../__snapshots__/jsfmt.spec.js.snap | 37 +++++++++++++++++++ .../optional-chaining.js | 3 ++ .../record/__snapshots__/jsfmt.spec.js.snap | 30 +++++++++++++++ tests/js/record/invalid-record-method.js | 9 +++++ .../js/tuple/__snapshots__/jsfmt.spec.js.snap | 28 ++++++++++++++ tests/js/tuple/invalid-tuple-holes.js | 1 + tests/js/tuple/tuple-trailing-comma.js | 1 + .../js/__snapshots__/jsfmt.spec.js.snap | 8 +--- yarn.lock | 7 +--- 11 files changed, 125 insertions(+), 14 deletions(-) create mode 100644 tests/js/classes-private-fields/optional-chaining.js create mode 100644 tests/js/record/invalid-record-method.js create mode 100644 tests/js/tuple/invalid-tuple-holes.js create mode 100644 tests/js/tuple/tuple-trailing-comma.js diff --git a/package.json b/package.json index 833255cfe..b3f44d85a 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "dependencies": { "@angular/compiler": "10.0.2", "@babel/code-frame": "7.10.4", - "@babel/parser": "7.10.3", + "@babel/parser": "7.10.4", "@glimmer/syntax": "0.54.0", "@iarna/toml": "2.2.5", "@typescript-eslint/typescript-estree": "3.5.0", diff --git a/src/language-js/parser-babel.js b/src/language-js/parser-babel.js index d3acba2d5..2efa38f77 100644 --- a/src/language-js/parser-babel.js +++ b/src/language-js/parser-babel.js @@ -82,7 +82,18 @@ function createParse(parseMethod, ...pluginCombinations) { babelOptions({ sourceType, extraPlugins }) ) ); - } catch (error) { + } catch (_error) { + // babel@7.10.4 throws `undefined`, when parsing + // ```js + // alert( + //