Add test infrastructure for JS source map parser and generator
This commit is contained in:
@@ -608,13 +608,9 @@ public class JsToStringGenerationVisitor extends JsVisitor {
|
||||
}
|
||||
|
||||
p.maybeIndent();
|
||||
beforeNodePrinted(nameRef);
|
||||
p.print(nameRef.getIdent());
|
||||
}
|
||||
|
||||
protected void beforeNodePrinted(JsNode node) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitNew(@NotNull JsNew x) {
|
||||
p.print(CHARS_NEW);
|
||||
|
||||
@@ -13,20 +13,24 @@ import java.util.List;
|
||||
public final class JsObjectLiteral extends JsLiteral {
|
||||
private final List<JsPropertyInitializer> properties;
|
||||
|
||||
private final boolean multiline;
|
||||
private boolean multiline;
|
||||
|
||||
public JsObjectLiteral() {
|
||||
this(new SmartList<JsPropertyInitializer>());
|
||||
this(new SmartList<>());
|
||||
}
|
||||
|
||||
public JsObjectLiteral(boolean multiline) {
|
||||
this(new SmartList<JsPropertyInitializer>(), multiline);
|
||||
this(new SmartList<>(), multiline);
|
||||
}
|
||||
|
||||
public boolean isMultiline() {
|
||||
return multiline;
|
||||
}
|
||||
|
||||
public void setMultiline(boolean multiline) {
|
||||
this.multiline = multiline;
|
||||
}
|
||||
|
||||
public JsObjectLiteral(List<JsPropertyInitializer> properties) {
|
||||
this(properties, false);
|
||||
}
|
||||
|
||||
@@ -18,14 +18,14 @@ import java.util.*;
|
||||
public class JsVars extends SourceInfoAwareJsNode implements JsStatement, Iterable<JsVars.JsVar> {
|
||||
private final List<JsVar> vars;
|
||||
|
||||
private final boolean multiline;
|
||||
private boolean multiline;
|
||||
|
||||
public JsVars() {
|
||||
this(new SmartList<JsVar>(), false);
|
||||
this(new SmartList<>(), false);
|
||||
}
|
||||
|
||||
public JsVars(boolean multiline) {
|
||||
this(new SmartList<JsVar>(), multiline);
|
||||
this(new SmartList<>(), multiline);
|
||||
}
|
||||
|
||||
public JsVars(List<JsVar> vars, boolean multiline) {
|
||||
@@ -34,17 +34,21 @@ public class JsVars extends SourceInfoAwareJsNode implements JsStatement, Iterab
|
||||
}
|
||||
|
||||
public JsVars(JsVar var) {
|
||||
this(new SmartList<JsVar>(var), false);
|
||||
this(new SmartList<>(var), false);
|
||||
}
|
||||
|
||||
public JsVars(JsVar... vars) {
|
||||
this(new SmartList<JsVar>(vars), false);
|
||||
this(new SmartList<>(vars), false);
|
||||
}
|
||||
|
||||
public boolean isMultiline() {
|
||||
return multiline;
|
||||
}
|
||||
|
||||
public void setMultiline(boolean multiline) {
|
||||
this.multiline = multiline;
|
||||
}
|
||||
|
||||
/**
|
||||
* A var declared using the JavaScript <code>var</code> statement.
|
||||
*/
|
||||
@@ -138,6 +142,7 @@ public class JsVars extends SourceInfoAwareJsNode implements JsStatement, Iterab
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public Iterator<JsVar> iterator() {
|
||||
return vars.iterator();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user