Inline function checkSmartPipelineHeadEarlyErrors

It's only used once.
This commit is contained in:
James DiGioia
2018-07-12 22:47:45 -04:00
parent ef0f723fc5
commit b50fdc191e

View File

@@ -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`,
);
}
}
}