diff --git a/src/parser/expression.js b/src/parser/expression.js index d2189e6c40..c03b2b57ee 100644 --- a/src/parser/expression.js +++ b/src/parser/expression.js @@ -151,7 +151,7 @@ export default class ExpressionParser extends LValParser { // Parse a ternary conditional (`?:`) operator. - parseMaybeConditional(noIn: ?boolean, refShorthandDefaultPos: Pos, refNeedsArrowPos: ?Pos): N.Expression { + parseMaybeConditional(noIn: ?boolean, refShorthandDefaultPos: Pos, refNeedsArrowPos?: ?Pos): N.Expression { const startPos = this.state.start; const startLoc = this.state.startLoc; const expr = this.parseExprOps(noIn, refShorthandDefaultPos); @@ -160,7 +160,15 @@ export default class ExpressionParser extends LValParser { return this.parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos); } - parseConditional(expr: N.Expression, noIn: ?boolean, startPos: number, startLoc: Position): N.Expression { + parseConditional( + expr: N.Expression, + noIn: ?boolean, + startPos: number, + startLoc: Position, + // FIXME: Disabling this for now since can't seem to get it to play nicely + // eslint-disable-next-line no-unused-vars + refNeedsArrowPos?: ?Pos + ): N.Expression { if (this.eat(tt.question)) { const node = this.startNodeAt(startPos, startLoc); node.test = expr; @@ -470,7 +478,7 @@ export default class ExpressionParser extends LValParser { const oldLabels = this.state.labels; this.state.labels = []; this.state.inFunction = false; - node.body = this.parseBlock(false, true); + node.body = this.parseBlock(false); this.state.inFunction = oldInFunction; this.state.labels = oldLabels; return this.finishNode(node, "DoExpression"); diff --git a/src/plugins/flow.js b/src/plugins/flow.js index 83416c3726..1f0d079ecf 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -1072,7 +1072,7 @@ export default (superClass: Class): Class => class extends super return super.isExportDefaultSpecifier(); } - parseConditional(expr: N.Expression, noIn: ?boolean, startPos: number, startLoc: Position, refNeedsArrowPos?: Pos): N.Expression { + parseConditional(expr: N.Expression, noIn: ?boolean, startPos: number, startLoc: Position, refNeedsArrowPos?: ?Pos): N.Expression { // only do the expensive clone if there is a question mark // and if we come from inside parens if (refNeedsArrowPos && this.match(tt.question)) { @@ -1260,8 +1260,8 @@ export default (superClass: Class): Class => class extends super } // parse a the super class type parameters and implements - parseClassSuper(node: N.Class, isStatement?: boolean): void { - super.parseClassSuper(node, isStatement); + parseClassSuper(node: N.Class): void { + super.parseClassSuper(node); if (node.superClass && this.isRelational("<")) { node.superTypeParameters = this.flowParseTypeParameterInstantiation(); }