Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: pkg/compiler/lib/src/mirrors/dart2js_library_mirror.dart

Issue 1192103002: Support serialization of the compiler backbone. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Handle (bypass) external const constructors. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/library_loader.dart ('k') | pkg/compiler/lib/src/ordered_typeset.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 7
8 class Dart2JsLibraryMirror 8 class Dart2JsLibraryMirror
9 extends Dart2JsElementMirror 9 extends Dart2JsElementMirror
10 with ObjectMirrorMixin, ContainerMixin 10 with ObjectMirrorMixin, ContainerMixin
(...skipping 15 matching lines...) Expand all
26 26
27 bool get isPrivate => false; 27 bool get isPrivate => false;
28 28
29 LibraryMirror library() => this; 29 LibraryMirror library() => this;
30 30
31 /** 31 /**
32 * Returns the library name (for libraries with a library tag) or the script 32 * Returns the library name (for libraries with a library tag) or the script
33 * file name (for scripts without a library tag). The latter case is used to 33 * file name (for scripts without a library tag). The latter case is used to
34 * provide a 'library name' for scripts, to use for instance in dartdoc. 34 * provide a 'library name' for scripts, to use for instance in dartdoc.
35 */ 35 */
36 String get _simpleNameString { 36 String get _simpleNameString => _element.getLibraryOrScriptName();
37 if (_element.libraryTag != null) {
38 return _element.libraryTag.name.toString();
39 } else {
40 // Use the file name as script name.
41 String path = _element.canonicalUri.path;
42 return path.substring(path.lastIndexOf('/') + 1);
43 }
44 }
45 37
46 Symbol get qualifiedName => simpleName; 38 Symbol get qualifiedName => simpleName;
47 39
48 void _forEachElement(f(Element element)) => _element.forEachLocalMember(f); 40 void _forEachElement(f(Element element)) => _element.forEachLocalMember(f);
49 41
50 Iterable<Dart2JsDeclarationMirror> _getDeclarationMirrors(Element element) { 42 Iterable<Dart2JsDeclarationMirror> _getDeclarationMirrors(Element element) {
51 if (element.isClass || element.isTypedef) { 43 if (element.isClass || element.isTypedef) {
52 return [mirrorSystem._getTypeDeclarationMirror(element)]; 44 return [mirrorSystem._getTypeDeclarationMirror(element)];
53 } else { 45 } else {
54 return super._getDeclarationMirrors(element); 46 return super._getDeclarationMirrors(element);
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 int get offset => _span.begin; 232 int get offset => _span.begin;
241 233
242 int get length => _span.end - _span.begin; 234 int get length => _span.end - _span.begin;
243 235
244 String get text => _script.text.substring(_span.begin, _span.end); 236 String get text => _script.text.substring(_span.begin, _span.end);
245 237
246 Uri get sourceUri => _script.resourceUri; 238 Uri get sourceUri => _script.resourceUri;
247 239
248 String get sourceText => _script.text; 240 String get sourceText => _script.text;
249 } 241 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/library_loader.dart ('k') | pkg/compiler/lib/src/ordered_typeset.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698