| 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..3a4eb9777c3542a2d5834615307d3d97621b6908 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,24 +185,17 @@ 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);
|
| -
|
| VariableUse asVariableUse() => null;
|
|
|
| bool get isCommaOperator => false;
|
| @@ -227,9 +218,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 +524,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.
|
|
|