mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Merge pull request #20811 from github/redsun82/update-rules_java
Javascript: fix errors from upcoming `rules_java` update
This commit is contained in:
@@ -286,6 +286,7 @@ public class Parser {
|
||||
raise(pos, msg, false);
|
||||
}
|
||||
|
||||
@SuppressWarnings("ReturnValueIgnored")
|
||||
protected void raise(Position loc, String msg, boolean recoverable) {
|
||||
msg += " (" + loc.getLine() + ":" + loc.getColumn() + ")";
|
||||
SyntaxError err = new SyntaxError(msg, loc, this.pos);
|
||||
@@ -3114,7 +3115,7 @@ public class Parser {
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
if (oldStrict == Boolean.FALSE) this.setStrict(false);
|
||||
if (Boolean.FALSE.equals(oldStrict)) this.setStrict(false);
|
||||
return this.finishNode(new BlockStatement(new SourceLocation(startLoc), body));
|
||||
}
|
||||
|
||||
|
||||
@@ -141,6 +141,7 @@ public class FlowParser extends ESNextParser {
|
||||
options.onRecoverableError(this.onRecoverableError);
|
||||
}
|
||||
|
||||
@SuppressWarnings("ReturnValueIgnored")
|
||||
private void commit() {
|
||||
// commit buffered tokens
|
||||
options.onToken(this.onToken);
|
||||
|
||||
@@ -35,8 +35,8 @@ public abstract class AFunctionExpression extends Expression implements IFunctio
|
||||
id,
|
||||
params,
|
||||
body,
|
||||
generator == Boolean.TRUE,
|
||||
async == Boolean.TRUE,
|
||||
Boolean.TRUE.equals(generator),
|
||||
Boolean.TRUE.equals(async),
|
||||
typeParameters,
|
||||
parameterTypes,
|
||||
parameterDecorators,
|
||||
|
||||
@@ -10,7 +10,7 @@ public class ComprehensionBlock extends Expression {
|
||||
super("ComprehensionBlock", loc);
|
||||
this.left = left;
|
||||
this.right = right;
|
||||
this.of = of != Boolean.FALSE;
|
||||
this.of = !Boolean.FALSE.equals(of);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,7 +19,7 @@ public class ComprehensionExpression extends Expression {
|
||||
this.body = body;
|
||||
this.blocks = blocks;
|
||||
this.filter = filter;
|
||||
this.generator = generator == Boolean.TRUE;
|
||||
this.generator = Boolean.TRUE.equals(generator);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,7 +16,7 @@ public class ForInStatement extends EnhancedForStatement {
|
||||
public ForInStatement(
|
||||
SourceLocation loc, Node left, Expression right, Statement body, Boolean each) {
|
||||
super("ForInStatement", loc, left, right, body);
|
||||
this.each = each == Boolean.TRUE;
|
||||
this.each = Boolean.TRUE.equals(each);
|
||||
}
|
||||
|
||||
public boolean isEach() {
|
||||
|
||||
@@ -27,8 +27,8 @@ public abstract class InvokeExpression extends Expression implements INodeWithSy
|
||||
this.callee = callee;
|
||||
this.typeArguments = typeArguments;
|
||||
this.arguments = arguments;
|
||||
this.optional = optional == Boolean.TRUE;
|
||||
this.onOptionalChain = onOptionalChain == Boolean.TRUE;
|
||||
this.optional = Boolean.TRUE.equals(optional);
|
||||
this.onOptionalChain = Boolean.TRUE.equals(onOptionalChain);
|
||||
}
|
||||
|
||||
/** The callee expression of this invocation. */
|
||||
|
||||
@@ -76,7 +76,7 @@ public class Literal extends Expression implements ITypeExpression {
|
||||
if (isRegExp()) return false;
|
||||
return value == null
|
||||
|| value instanceof Number && ((Number) value).intValue() == 0
|
||||
|| value == Boolean.FALSE
|
||||
|| Boolean.FALSE.equals(value)
|
||||
|| value instanceof String && ((String) value).isEmpty();
|
||||
}
|
||||
|
||||
|
||||
@@ -22,9 +22,9 @@ public class MemberExpression extends Expression
|
||||
super("MemberExpression", loc);
|
||||
this.object = object;
|
||||
this.property = property;
|
||||
this.computed = computed == Boolean.TRUE;
|
||||
this.optional = optional == Boolean.TRUE;
|
||||
this.onOptionalChain = onOptionalChain == Boolean.TRUE;
|
||||
this.computed = Boolean.TRUE.equals(computed);
|
||||
this.optional = Boolean.TRUE.equals(optional);
|
||||
this.onOptionalChain = Boolean.TRUE.equals(onOptionalChain);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -59,8 +59,8 @@ public class Property extends Node {
|
||||
}
|
||||
this.rawValue = rawValue;
|
||||
this.kind = Kind.valueOf(StringUtil.uc(kind));
|
||||
this.computed = computed == Boolean.TRUE;
|
||||
this.method = method == Boolean.TRUE;
|
||||
this.computed = Boolean.TRUE.equals(computed);
|
||||
this.method = Boolean.TRUE.equals(method);
|
||||
this.decorators = new ArrayList<Decorator>();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ public class TemplateElement extends Expression {
|
||||
super("TemplateElement", loc);
|
||||
this.cooked = cooked;
|
||||
this.raw = raw;
|
||||
this.tail = tail == Boolean.TRUE;
|
||||
this.tail = Boolean.TRUE.equals(tail);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,7 +14,7 @@ public class UnaryExpression extends Expression {
|
||||
super("UnaryExpression", loc);
|
||||
this.operator = operator;
|
||||
this.argument = argument;
|
||||
this.prefix = prefix == Boolean.TRUE;
|
||||
this.prefix = Boolean.TRUE.equals(prefix);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,7 +11,7 @@ public class UpdateExpression extends Expression {
|
||||
super("UpdateExpression", loc);
|
||||
this.operator = operator;
|
||||
this.argument = argument;
|
||||
this.prefix = prefix == Boolean.TRUE;
|
||||
this.prefix = Boolean.TRUE.equals(prefix);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,7 +8,7 @@ public class YieldExpression extends Expression {
|
||||
public YieldExpression(SourceLocation loc, Expression argument, Boolean delegating) {
|
||||
super("YieldExpression", loc);
|
||||
this.argument = argument;
|
||||
this.delegating = delegating == Boolean.TRUE;
|
||||
this.delegating = Boolean.TRUE.equals(delegating);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,7 +18,7 @@ public class FunctionType extends JSDocTypeExpression {
|
||||
JSDocTypeExpression result) {
|
||||
super(loc, "FunctionType");
|
||||
this._this = _this;
|
||||
this._new = _new == Boolean.TRUE;
|
||||
this._new = Boolean.TRUE.equals(_new);
|
||||
this.params = params;
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ public abstract class UnaryTypeConstructor extends JSDocTypeExpression {
|
||||
String operator) {
|
||||
super(loc, type);
|
||||
this.expression = expression;
|
||||
this.prefix = prefix == Boolean.TRUE;
|
||||
this.prefix = Boolean.TRUE.equals(prefix);
|
||||
this.operator = operator;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ public class CharacterClass extends RegExpTerm {
|
||||
public CharacterClass(SourceLocation loc, List<RegExpTerm> elements, Boolean inverted) {
|
||||
super(loc, "CharacterClass");
|
||||
this.elements = elements;
|
||||
this.inverted = inverted == Boolean.TRUE;
|
||||
this.inverted = Boolean.TRUE.equals(inverted);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,7 +10,7 @@ public abstract class Quantifier extends RegExpTerm {
|
||||
public Quantifier(SourceLocation loc, String type, RegExpTerm operand, Boolean greedy) {
|
||||
super(loc, type);
|
||||
this.operand = operand;
|
||||
this.greedy = greedy == Boolean.TRUE;
|
||||
this.greedy = Boolean.TRUE.equals(greedy);
|
||||
}
|
||||
|
||||
/** The quantified term. */
|
||||
|
||||
Reference in New Issue
Block a user