| Index: pkg/compiler/lib/src/io/start_end_information.dart
|
| diff --git a/pkg/compiler/lib/src/io/start_end_information.dart b/pkg/compiler/lib/src/io/start_end_information.dart
|
| index f7d4dce1369fc7e34041cc999e43ae1d866742e3..71a3aec938bfb458bc3b69a14b6d9375f79f6cf2 100644
|
| --- a/pkg/compiler/lib/src/io/start_end_information.dart
|
| +++ b/pkg/compiler/lib/src/io/start_end_information.dart
|
| @@ -129,8 +129,27 @@ class StartEndSourceInformationProcessor extends SourceInformationProcessor {
|
| /// registered for the top-most node with source information.
|
| bool hasRegisteredRoot = false;
|
|
|
| + /// The root of the tree. Used to add a [NoSourceLocationMarker] to the start
|
| + /// of the output.
|
| + js.Node root;
|
| +
|
| + /// The root of the current subtree with source information. Used to add
|
| + /// [NoSourceLocationMarker] after areas with source information.
|
| + js.Node subRoot;
|
| +
|
| StartEndSourceInformationProcessor(this.sourceMapper);
|
|
|
| + void onStartPosition(js.Node node, int startPosition) {
|
| + if (root == null) {
|
| + root = node;
|
| + sourceMapper.register(
|
| + node, startPosition, const NoSourceLocationMarker());
|
| + }
|
| + if (subRoot == null && node.sourceInformation != null) {
|
| + subRoot = node;
|
| + }
|
| + }
|
| +
|
| @override
|
| void onPositions(
|
| js.Node node, int startPosition, int endPosition, int closingPosition) {
|
| @@ -145,6 +164,11 @@ class StartEndSourceInformationProcessor extends SourceInformationProcessor {
|
| sourceMapper.register(node, endPosition, null);
|
| hasRegisteredRoot = true;
|
| }
|
| + if (node == subRoot) {
|
| + sourceMapper.register(
|
| + node, endPosition, const NoSourceLocationMarker());
|
| + subRoot = null;
|
| + }
|
| }
|
| }
|
| }
|
|
|