Reverse yoda conditions

If "smart" proposal is, we'll no longer say.
This commit is contained in:
James DiGioia 2018-07-12 22:46:34 -04:00
parent fbf62b4830
commit ef0f723fc5
2 changed files with 4 additions and 4 deletions

View File

@ -307,7 +307,7 @@ export default class ExpressionParser extends LValParser {
if (
op === tt.pipeline &&
"minimal" === this.getPluginOption("pipelineOperator", "proposal")
this.getPluginOption("pipelineOperator", "proposal") === "minimal"
) {
if (
this.match(tt.name) &&
@ -354,7 +354,7 @@ export default class ExpressionParser extends LValParser {
): N.Expression {
switch (op) {
case tt.pipeline:
if ("smart" === this.getPluginOption("pipelineOperator", "proposal")) {
if (this.getPluginOption("pipelineOperator", "proposal") === "smart") {
const startPos = this.state.start;
const startLoc = this.state.startLoc;
return this.withTopicPermittingContext(() => {
@ -1995,7 +1995,7 @@ export default class ExpressionParser extends LValParser {
checkPipelineAtInfixOperator(left: N.Expression, leftStartPos: number) {
this.expectPlugin("pipelineOperator");
if ("smart" === this.getPluginOption("pipelineOperator", "proposal")) {
if (this.getPluginOption("pipelineOperator", "proposal") === "smart") {
this.checkSmartPipelineHeadEarlyErrors(left, leftStartPos);
}
}

View File

@ -421,7 +421,7 @@ export default class Tokenizer extends LocationParser {
this.finishToken(tt.hash);
return;
} else if (
"smart" === this.getPluginOption("pipelineOperator", "proposal")
this.getPluginOption("pipelineOperator", "proposal") === "smart"
) {
if (next >= charCodes.digit0 && next <= charCodes.digit9) {
this.raise(