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 library dart2js.source_information; | 5 library dart2js.source_information; |
6 | 6 |
7 import '../dart2jslib.dart' show SourceSpan, MessageKind; | 7 import '../diagnostics/source_span.dart' show |
| 8 SourceSpan; |
8 import '../elements/elements.dart' show | 9 import '../elements/elements.dart' show |
9 AstElement, | 10 AstElement, |
10 LocalElement; | 11 LocalElement; |
11 import '../tree/tree.dart' show Node, Send; | 12 import '../tree/tree.dart' show |
| 13 Node, |
| 14 Send; |
12 import '../js/js.dart' show | 15 import '../js/js.dart' show |
13 JavaScriptNodeSourceInformation; | 16 JavaScriptNodeSourceInformation; |
14 import 'source_file.dart'; | 17 import 'source_file.dart'; |
15 | 18 |
16 bool useNewSourceInfo = | 19 bool useNewSourceInfo = |
17 const bool.fromEnvironment('USE_NEW_SOURCE_INFO', defaultValue: false); | 20 const bool.fromEnvironment('USE_NEW_SOURCE_INFO', defaultValue: false); |
18 | 21 |
19 /// Interface for passing source information, for instance for use in source | 22 /// Interface for passing source information, for instance for use in source |
20 /// maps, through the backend. | 23 /// maps, through the backend. |
21 abstract class SourceInformation extends JavaScriptNodeSourceInformation { | 24 abstract class SourceInformation extends JavaScriptNodeSourceInformation { |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 return '${computeElementNameForSourceMaps(local.executableContext)}.$name'; | 191 return '${computeElementNameForSourceMaps(local.executableContext)}.$name'; |
189 } else if (element.enclosingClass != null) { | 192 } else if (element.enclosingClass != null) { |
190 if (element.enclosingClass.isClosure) { | 193 if (element.enclosingClass.isClosure) { |
191 return computeElementNameForSourceMaps(element.enclosingClass); | 194 return computeElementNameForSourceMaps(element.enclosingClass); |
192 } | 195 } |
193 return '${element.enclosingClass.name}.${element.name}'; | 196 return '${element.enclosingClass.name}.${element.name}'; |
194 } else { | 197 } else { |
195 return element.name; | 198 return element.name; |
196 } | 199 } |
197 } | 200 } |
OLD | NEW |