You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 18, 2021. It is now read-only.
Nullish is treated like a logical expression (which it IMVHO ain't), crashing the eslint parser while linting (and probably causing screwups in other contexts).
I used Babylon (edge) via babel-eslint (edge) to lint the code with ?? in it.
Expected Behavior
Nullish is essentially a binary expression, not a logical one. Neither of the operands has to be logical for it to work properly. Strictly speaking, boolean value of 1st operand is mostly not important (w.r.t. most of the falsey states), and is completely ignored for the 2nd.
Current Behavior
Nullish is treated like a logical expression, crashing the parser while linting (and probably causing screwups in other contexts).
Module build failed: Error: unreachable
at CodePathState.popChoiceContext (/path/node_modules/eslint/lib/code-path-analysis/code-path-state.js:444:23)
at processCodePathToExit (/path/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:434:19)
at CodePathAnalyzer.leaveNode (/path/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:623:9)
at CodePathAnalyzer.overrideLeaveNode (/path/node_modules/eslint-plugin-node/lib/rules/process-exit-as-throw.js:127:27)
at Traverser.leave (/path/node_modules/eslint/lib/linter.js:958:32)
at Traverser.__execute (/path/node_modules/estraverse/estraverse.js:397:31)
at Traverser.traverse (/path/node_modules/estraverse/estraverse.js:491:28)
at Traverser.traverse (/path/node_modules/eslint/lib/util/traverser.js:31:22)
at Linter._verifyWithoutProcessors (/path/node_modules/eslint/lib/linter.js:952:19)
at preprocess.map.textBlock (/path/node_modules/eslint/lib/linter.js:993:35)
at Array.map (native)
at Linter.verify (/path/node_modules/eslint/lib/linter.js:992:42)
at localVerify (/path/node_modules/eslint-plugin-html/src/index.js:107:14)
at Linter.eslint.verify (/path/node_modules/eslint-plugin-html/src/index.js:147:18)
at Linter.verifyAndFix (/path/node_modules/eslint/lib/linter.js:1074:29)
at processText (/path/node_modules/eslint/lib/cli-engine.js:175:32)
Original issue submitted by @FyiurAmron in babel/babel#6750
Nullish is treated like a logical expression (which it IMVHO ain't), crashing the eslint parser while linting (and probably causing screwups in other contexts).
Input Code
var a = b ?? c;
Babel/Babylon Configuration (.babelrc, package.json, cli command)
I used Babylon (edge) via babel-eslint (edge) to lint the code with
??
in it.Expected Behavior
Nullish is essentially a binary expression, not a logical one. Neither of the operands has to be logical for it to work properly. Strictly speaking, boolean value of 1st operand is mostly not important (w.r.t. most of the falsey states), and is completely ignored for the 2nd.
Current Behavior
Nullish is treated like a logical expression, crashing the parser while linting (and probably causing screwups in other contexts).
Possible Solution
replace the condition in https://github.com/babel/babel/blob/master/packages/babylon/src/parser/expression.js#L317 to be more sane vs nullish, i.e.
doing so fixed the problem completely for me.
Context
babel-eslint, eslint
Your Environment
The text was updated successfully, but these errors were encountered: