From b50fdc191e745169666286a4bf8cc6b074e31424 Mon Sep 17 00:00:00 2001 From: James DiGioia Date: Thu, 12 Jul 2018 22:47:45 -0400 Subject: [PATCH] Inline function checkSmartPipelineHeadEarlyErrors It's only used once. --- .../babel-parser/src/parser/expression.js | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 33cc0b8eab..e26f77f1ab 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -1996,18 +1996,14 @@ export default class ExpressionParser extends LValParser { this.expectPlugin("pipelineOperator"); if (this.getPluginOption("pipelineOperator", "proposal") === "smart") { - this.checkSmartPipelineHeadEarlyErrors(left, leftStartPos); - } - } - - checkSmartPipelineHeadEarlyErrors(left: N.Expression, leftStartPos: number) { - if (left.type === "SequenceExpression") { - // Ensure that the pipeline head is not a comma-delimited - // sequence expression. - throw this.raise( - leftStartPos, - `Pipeline head may not be a comma-separated sequence expression`, - ); + if (left.type === "SequenceExpression") { + // Ensure that the pipeline head is not a comma-delimited + // sequence expression. + throw this.raise( + leftStartPos, + `Pipeline head may not be a comma-separated sequence expression`, + ); + } } }