Remove unused parser methods (#10942)

* chore: remove unused isStrictBody

* chore: remove unused eatRelational
This commit is contained in:
Huáng Jùnliàng
2019-12-30 16:09:50 -05:00
committed by GitHub
parent 314513374d
commit 197a8da04d
3 changed files with 0 additions and 44 deletions

View File

@@ -174,26 +174,6 @@ export default (superClass: Class<Parser>): Class<Parser> =>
}
}
isStrictBody(node: { body: N.BlockStatement }): boolean {
const isBlockStatement = node.body.type === "BlockStatement";
if (isBlockStatement && node.body.body.length > 0) {
for (const directive of node.body.body) {
if (
directive.type === "ExpressionStatement" &&
directive.expression.type === "Literal"
) {
if (directive.expression.value === "use strict") return true;
} else {
// Break for the first non literal expression
break;
}
}
}
return false;
}
isValidDirective(stmt: N.Statement): boolean {
return (
stmt.type === "ExpressionStatement" &&