OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 part of dart2js.mirrors; | 5 part of dart2js.mirrors; |
6 | 6 |
7 class Dart2JsLibraryMirror | 7 class Dart2JsLibraryMirror |
8 extends Dart2JsElementMirror | 8 extends Dart2JsElementMirror |
9 with ObjectMirrorMixin, ContainerMixin | 9 with ObjectMirrorMixin, ContainerMixin |
10 implements LibrarySourceMirror { | 10 implements LibrarySourceMirror { |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 final Dart2JsLibraryMirror _targetLibrary; | 119 final Dart2JsLibraryMirror _targetLibrary; |
120 List<CombinatorMirror> _combinators; | 120 List<CombinatorMirror> _combinators; |
121 | 121 |
122 Dart2JsLibraryDependencyMirror(this._node, | 122 Dart2JsLibraryDependencyMirror(this._node, |
123 this._sourceLibrary, | 123 this._sourceLibrary, |
124 this._targetLibrary); | 124 this._targetLibrary); |
125 | 125 |
126 SourceLocation get location { | 126 SourceLocation get location { |
127 return new Dart2JsSourceLocation( | 127 return new Dart2JsSourceLocation( |
128 _sourceLibrary._element.entryCompilationUnit.script, | 128 _sourceLibrary._element.entryCompilationUnit.script, |
129 _sourceLibrary.mirrorSystem.compiler.spanFromNode(_node)); | 129 _sourceLibrary.mirrorSystem.compiler.reporter.spanFromSpannable(_node)); |
130 } | 130 } |
131 | 131 |
132 List<CombinatorMirror> get combinators { | 132 List<CombinatorMirror> get combinators { |
133 if (_combinators == null) { | 133 if (_combinators == null) { |
134 _combinators = <CombinatorMirror>[]; | 134 _combinators = <CombinatorMirror>[]; |
135 if (_node.combinators != null) { | 135 if (_node.combinators != null) { |
136 for (Combinator combinator in _node.combinators.nodes) { | 136 for (Combinator combinator in _node.combinators.nodes) { |
137 List<String> identifiers = <String>[]; | 137 List<String> identifiers = <String>[]; |
138 for (Identifier identifier in combinator.identifiers.nodes) { | 138 for (Identifier identifier in combinator.identifiers.nodes) { |
139 identifiers.add(identifier.source); | 139 identifiers.add(identifier.source); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 int get offset => _span.begin; | 248 int get offset => _span.begin; |
249 | 249 |
250 int get length => _span.end - _span.begin; | 250 int get length => _span.end - _span.begin; |
251 | 251 |
252 String get text => _script.text.substring(_span.begin, _span.end); | 252 String get text => _script.text.substring(_span.begin, _span.end); |
253 | 253 |
254 Uri get sourceUri => _script.resourceUri; | 254 Uri get sourceUri => _script.resourceUri; |
255 | 255 |
256 String get sourceText => _script.text; | 256 String get sourceText => _script.text; |
257 } | 257 } |
OLD | NEW |