| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /// Source information system mapping that attempts a semantic mapping between | 5 /// Source information system mapping that attempts a semantic mapping between |
| 6 /// offsets of JavaScript code points to offsets of Dart code points. | 6 /// offsets of JavaScript code points to offsets of Dart code points. |
| 7 | 7 |
| 8 library dart2js.source_information.position; | 8 library dart2js.source_information.position; |
| 9 | 9 |
| 10 import '../dart2jslib.dart' show | 10 import '../dart2jslib.dart' show |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 /// Builds a source information object pointing the start position of [node]. | 142 /// Builds a source information object pointing the start position of [node]. |
| 143 SourceInformation buildBegin(Node node) { | 143 SourceInformation buildBegin(Node node) { |
| 144 return new PositionSourceInformation(new OffsetSourceLocation( | 144 return new PositionSourceInformation(new OffsetSourceLocation( |
| 145 sourceFile, node.getBeginToken().charOffset, name)); | 145 sourceFile, node.getBeginToken().charOffset, name)); |
| 146 } | 146 } |
| 147 | 147 |
| 148 @override | 148 @override |
| 149 SourceInformation buildGeneric(Node node) => buildBegin(node); | 149 SourceInformation buildGeneric(Node node) => buildBegin(node); |
| 150 | 150 |
| 151 @override | 151 @override |
| 152 SourceInformation buildCreate(Node node) => buildBegin(node); |
| 153 |
| 154 @override |
| 152 SourceInformation buildReturn(Node node) => buildBegin(node); | 155 SourceInformation buildReturn(Node node) => buildBegin(node); |
| 153 | 156 |
| 154 @override | 157 @override |
| 155 SourceInformation buildImplicitReturn(AstElement element) { | 158 SourceInformation buildImplicitReturn(AstElement element) { |
| 156 if (element.isSynthesized) { | 159 if (element.isSynthesized) { |
| 157 return new PositionSourceInformation( | 160 return new PositionSourceInformation( |
| 158 new OffsetSourceLocation( | 161 new OffsetSourceLocation( |
| 159 sourceFile, element.position.charOffset, name)); | 162 sourceFile, element.position.charOffset, name)); |
| 160 } else { | 163 } else { |
| 161 return new PositionSourceInformation( | 164 return new PositionSourceInformation( |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 | 433 |
| 431 @override | 434 @override |
| 432 void onPositions(js.Node node, | 435 void onPositions(js.Node node, |
| 433 int startPosition, | 436 int startPosition, |
| 434 int endPosition, | 437 int endPosition, |
| 435 int closingPosition) { | 438 int closingPosition) { |
| 436 codePositions.registerPositions( | 439 codePositions.registerPositions( |
| 437 node, startPosition, endPosition, closingPosition); | 440 node, startPosition, endPosition, closingPosition); |
| 438 } | 441 } |
| 439 } | 442 } |
| OLD | NEW |