Chromium Code Reviews| Index: pkg/compiler/lib/src/js/nodes.dart |
| diff --git a/pkg/compiler/lib/src/js/nodes.dart b/pkg/compiler/lib/src/js/nodes.dart |
| index e5b57f6351593fa734602e297c1558ad28d9ecd0..be5dee6cb7a3b4a48885d32256dac32fc5cfba40 100644 |
| --- a/pkg/compiler/lib/src/js/nodes.dart |
| +++ b/pkg/compiler/lib/src/js/nodes.dart |
| @@ -172,11 +172,9 @@ class BaseVisitor<T> implements NodeVisitor<T> { |
| } |
| abstract class Node { |
| - get sourcePosition => _sourcePosition; |
| - get endSourcePosition => _endSourcePosition; |
| + SourceInformation get sourceInformation => _sourceInformation; |
| - var _sourcePosition; |
| - var _endSourcePosition; |
| + SourceInformation _sourceInformation; |
| accept(NodeVisitor visitor); |
| void visitChildren(NodeVisitor visitor); |
| @@ -187,23 +185,21 @@ abstract class Node { |
| // Returns a node equivalent to [this], but with new source position and end |
| // source position. |
| - Node withPosition(var sourcePosition, var endSourcePosition) { |
| - if (sourcePosition == _sourcePosition && |
| - endSourcePosition == _endSourcePosition) { |
| + Node withSourceInformation(SourceInformation sourceInformation) { |
| + if (sourceInformation == _sourceInformation) { |
| return this; |
| } |
| Node clone = _clone(); |
| // TODO(sra): Should existing data be 'sticky' if we try to overwrite with |
| // `null`? |
| - clone._sourcePosition = sourcePosition; |
| - clone._endSourcePosition = endSourcePosition; |
| + clone._sourceInformation = sourceInformation; |
| return clone; |
| } |
| // Returns a node equivalent to [this], but with new [this.sourcePositions], |
| // keeping the existing [endPosition] |
| - Node withLocation(var sourcePosition) => |
| - withPosition(sourcePosition, this.endSourcePosition); |
| + //Node withLocation(var sourcePosition) => |
|
floitsch
2015/02/09 13:16:22
Remove?
Johnni Winther
2015/02/09 14:58:36
Done.
|
| + // withPosition(sourcePosition, this.endSourcePosition); |
| VariableUse asVariableUse() => null; |
| @@ -227,9 +223,6 @@ class Program extends Node { |
| abstract class Statement extends Node { |
| Statement toStatement() => this; |
| - |
| - Statement withPosition(var sourcePosition, var endSourcePosition) => |
| - super.withPosition(sourcePosition, endSourcePosition); |
| } |
| class Block extends Statement { |
| @@ -536,9 +529,6 @@ abstract class Expression extends Node { |
| int get precedenceLevel; |
| Statement toStatement() => new ExpressionStatement(this); |
| - |
| - Expression withPosition(var sourcePosition, var endSourcePosition) => |
| - super.withPosition(sourcePosition, endSourcePosition); |
| } |
| /// Wrap a CodeBuffer as an expression. |