mirror of
https://github.com/github/codeql.git
synced 2026-07-12 23:15:40 +02:00
JavaScript: Autoformat extractor sources using google-java-format.
No special settings; command: find javascript/extractor/src -name "*.java" | xargs java -jar /path/to/google-java-format-1.7-all-deps.jar --replace
This commit is contained in:
@@ -3,69 +3,70 @@ package com.semmle.js.ast;
|
||||
import com.semmle.ts.ast.INodeWithSymbol;
|
||||
import com.semmle.ts.ast.ITypeExpression;
|
||||
|
||||
/**
|
||||
* A member expression, either computed (<code>e[f]</code>) or static (<code>e.f</code>).
|
||||
*/
|
||||
public class MemberExpression extends Expression implements ITypeExpression, INodeWithSymbol, Chainable {
|
||||
private final Expression object, property;
|
||||
private final boolean computed;
|
||||
private final boolean optional;
|
||||
private final boolean onOptionalChain;
|
||||
private int symbol = -1;
|
||||
/** A member expression, either computed (<code>e[f]</code>) or static (<code>e.f</code>). */
|
||||
public class MemberExpression extends Expression
|
||||
implements ITypeExpression, INodeWithSymbol, Chainable {
|
||||
private final Expression object, property;
|
||||
private final boolean computed;
|
||||
private final boolean optional;
|
||||
private final boolean onOptionalChain;
|
||||
private int symbol = -1;
|
||||
|
||||
public MemberExpression(SourceLocation loc, Expression object, Expression property, Boolean computed, Boolean optional, Boolean onOptionalChain) {
|
||||
super("MemberExpression", loc);
|
||||
this.object = object;
|
||||
this.property = property;
|
||||
this.computed = computed == Boolean.TRUE;
|
||||
this.optional = optional == Boolean.TRUE;
|
||||
this.onOptionalChain = onOptionalChain == Boolean.TRUE;
|
||||
}
|
||||
public MemberExpression(
|
||||
SourceLocation loc,
|
||||
Expression object,
|
||||
Expression property,
|
||||
Boolean computed,
|
||||
Boolean optional,
|
||||
Boolean onOptionalChain) {
|
||||
super("MemberExpression", loc);
|
||||
this.object = object;
|
||||
this.property = property;
|
||||
this.computed = computed == Boolean.TRUE;
|
||||
this.optional = optional == Boolean.TRUE;
|
||||
this.onOptionalChain = onOptionalChain == Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, A> A accept(Visitor<Q, A> v, Q q) {
|
||||
return v.visit(this, q);
|
||||
}
|
||||
@Override
|
||||
public <Q, A> A accept(Visitor<Q, A> v, Q q) {
|
||||
return v.visit(this, q);
|
||||
}
|
||||
|
||||
/**
|
||||
* The base expression of this member expression.
|
||||
*/
|
||||
public Expression getObject() {
|
||||
return object;
|
||||
}
|
||||
/** The base expression of this member expression. */
|
||||
public Expression getObject() {
|
||||
return object;
|
||||
}
|
||||
|
||||
/**
|
||||
* The property expression of this member expression; for static member expressions this is always
|
||||
* an {@link Identifier}.
|
||||
*/
|
||||
public Expression getProperty() {
|
||||
return property;
|
||||
}
|
||||
/**
|
||||
* The property expression of this member expression; for static member expressions this is always
|
||||
* an {@link Identifier}.
|
||||
*/
|
||||
public Expression getProperty() {
|
||||
return property;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this a computed member expression?
|
||||
*/
|
||||
public boolean isComputed() {
|
||||
return computed;
|
||||
}
|
||||
/** Is this a computed member expression? */
|
||||
public boolean isComputed() {
|
||||
return computed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOptional() {
|
||||
return optional;
|
||||
}
|
||||
@Override
|
||||
public boolean isOptional() {
|
||||
return optional;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOnOptionalChain() {
|
||||
return onOptionalChain;
|
||||
}
|
||||
@Override
|
||||
public boolean isOnOptionalChain() {
|
||||
return onOptionalChain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSymbol() {
|
||||
return symbol;
|
||||
}
|
||||
@Override
|
||||
public int getSymbol() {
|
||||
return symbol;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSymbol(int symbol) {
|
||||
this.symbol = symbol;
|
||||
}
|
||||
@Override
|
||||
public void setSymbol(int symbol) {
|
||||
this.symbol = symbol;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user