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