perf: Use strict equals
This commit is contained in:
@@ -525,7 +525,7 @@ export default class ExpressionParser extends LValParser {
|
||||
} else if (this.match(tt.questionDot)) {
|
||||
this.expectPlugin("optionalChaining");
|
||||
state.optionalChainMember = true;
|
||||
if (noCalls && this.lookahead().type == tt.parenL) {
|
||||
if (noCalls && this.lookahead().type === tt.parenL) {
|
||||
state.stop = true;
|
||||
return base;
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ export default class StatementParser extends ExpressionParser {
|
||||
this.next();
|
||||
|
||||
let result;
|
||||
if (starttype == tt._import) {
|
||||
if (starttype === tt._import) {
|
||||
result = this.parseImport(node);
|
||||
|
||||
if (
|
||||
@@ -693,9 +693,9 @@ export default class StatementParser extends ExpressionParser {
|
||||
node.body = this.parseStatement(declaration);
|
||||
|
||||
if (
|
||||
node.body.type == "ClassDeclaration" ||
|
||||
(node.body.type == "VariableDeclaration" && node.body.kind !== "var") ||
|
||||
(node.body.type == "FunctionDeclaration" &&
|
||||
node.body.type === "ClassDeclaration" ||
|
||||
(node.body.type === "VariableDeclaration" && node.body.kind !== "var") ||
|
||||
(node.body.type === "FunctionDeclaration" &&
|
||||
(this.state.strict || node.body.generator || node.body.async))
|
||||
) {
|
||||
this.raise(node.body.start, "Invalid labeled declaration");
|
||||
|
||||
@@ -25,7 +25,7 @@ export default class UtilParser extends Tokenizer {
|
||||
|
||||
isLookaheadRelational(op: "<" | ">"): boolean {
|
||||
const l = this.lookahead();
|
||||
return l.type == tt.relational && l.value == op;
|
||||
return l.type === tt.relational && l.value === op;
|
||||
}
|
||||
|
||||
// TODO
|
||||
|
||||
@@ -1630,7 +1630,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
this.match(tt.name) &&
|
||||
(this.state.value === "type" ||
|
||||
this.state.value === "interface" ||
|
||||
this.state.value == "opaque")
|
||||
this.state.value === "opaque")
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user