for statement. If specified at all, the initializer part is
* either a declaration of one or more variables, in which case
@@ -86,12 +84,6 @@ public class JsFor extends JsNodeImpl implements JsStatement {
v.endVisit(this, context);
}
- @Override
- public JsFor setSourceRef(SourceInfo info) {
- super.setSourceRef(info);
- return this;
- }
-
@Override
public NodeKind getKind() {
return NodeKind.FOR;
diff --git a/src/com/google/dart/compiler/backend/js/ast/JsFunction.java b/src/com/google/dart/compiler/backend/js/ast/JsFunction.java
index a4e9914100d..1d4bd4da308 100644
--- a/src/com/google/dart/compiler/backend/js/ast/JsFunction.java
+++ b/src/com/google/dart/compiler/backend/js/ast/JsFunction.java
@@ -4,7 +4,6 @@
package com.google.dart.compiler.backend.js.ast;
-import com.google.dart.compiler.common.SourceInfo;
import com.google.dart.compiler.common.Symbol;
import com.intellij.util.SmartList;
import org.jetbrains.annotations.Nullable;
@@ -28,7 +27,7 @@ public final class JsFunction extends JsLiteral implements HasName {
private JsFunction(JsScope parentScope, @Nullable JsName name) {
this.name = name;
- this.scope = new JsScope(parentScope, name == null ? null : name.getIdent());
+ scope = new JsScope(parentScope, name == null ? null : name.getIdent());
}
public JsBlock getBody() {
@@ -99,12 +98,6 @@ public final class JsFunction extends JsLiteral implements HasName {
v.endVisit(this, context);
}
- @Override
- public JsFunction setSourceRef(SourceInfo info) {
- super.setSourceRef(info);
- return this;
- }
-
@Override
public NodeKind getKind() {
return NodeKind.FUNCTION;
diff --git a/src/com/google/dart/compiler/backend/js/ast/JsNodeImpl.java b/src/com/google/dart/compiler/backend/js/ast/JsNodeImpl.java
index 583f0e7de08..6128475681e 100644
--- a/src/com/google/dart/compiler/backend/js/ast/JsNodeImpl.java
+++ b/src/com/google/dart/compiler/backend/js/ast/JsNodeImpl.java
@@ -1,30 +1,20 @@
package com.google.dart.compiler.backend.js.ast;
-import com.google.dart.compiler.backend.js.JsToStringGenerationVisitor;
-import com.google.dart.compiler.common.AbstractNode;
import com.google.dart.compiler.common.SourceInfo;
-import com.google.dart.compiler.util.TextOutputImpl;
-abstract class JsNodeImpl extends AbstractNode implements JsNode {
+abstract class JsNodeImpl extends AbstractNode {
+ private SourceInfo sourceInfo;
+
protected JsNodeImpl() {
}
@Override
- public String toString() {
- TextOutputImpl out = new TextOutputImpl();
- new JsToStringGenerationVisitor(out).accept(this);
- return out.toString();
+ public SourceInfo getSourceInfo() {
+ return sourceInfo;
}
@Override
- public SourceInfo getSourceInfo() {
- return this;
+ public void setSourceInfo(SourceInfo info) {
+ sourceInfo = info;
}
-
- public JsNode setSourceRef(SourceInfo info) {
- if (info != null) {
- setSourceInfo(info);
- }
- return this;
- }
-}
+}
\ No newline at end of file
diff --git a/src/com/google/dart/compiler/backend/js/ast/JsVars.java b/src/com/google/dart/compiler/backend/js/ast/JsVars.java
index 18617861955..638a50ef496 100644
--- a/src/com/google/dart/compiler/backend/js/ast/JsVars.java
+++ b/src/com/google/dart/compiler/backend/js/ast/JsVars.java
@@ -4,7 +4,6 @@
package com.google.dart.compiler.backend.js.ast;
-import com.google.dart.compiler.common.SourceInfo;
import com.google.dart.compiler.common.Symbol;
import com.intellij.util.SmartList;
import org.jetbrains.annotations.Nullable;
@@ -91,12 +90,6 @@ public class JsVars extends JsNodeImpl implements JsStatement, Iterable
- * Each node in the subtree (other than the contrived nodes) carries source
- * range(s) information relating back to positions in the given source (the
- * given source itself is not remembered with the AST). The source range
- * usually begins at the first character of the first token corresponding to
- * the node; leading whitespace and comments are not included. The
- * source range usually extends through the last character of the last token
- * corresponding to the node; trailing whitespace and comments are not
- * included. There are a handful of exceptions (including the various body
- * declarations). Source ranges nest properly: the source range for a child is
- * always within the source range of its parent, and the source ranges of
- * sibling nodes never overlap.
- *
- * @param source the associated source
- * @param line the 1-based line index, or -1, if no source
- * location is available
- * @param column the 1-based column index, or -1, if no source
- * location is available
- * @param startPosition a 0-based character index, or -1, if no
- * source location is available
- * @param length a (possibly 0) length, or -1, if no source
- * location is available
- * @see SourceInfo#getStart()
- * @see SourceInfo#getLength()
- */
- void setSourceLocation(Source source, int line, int column, int startPosition, int length);
}