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

Side by Side Diff: lib/dartdoc/mirrors/dart2js_mirror.dart

Issue 10824275: Revert "Refactor Library/CompilationUnit and how we define local Scope." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « lib/compiler/implementation/scanner/scanner_task.dart ('k') | tests/co19/co19-leg.status » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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('mirrors.dart2js'); 5 #library('mirrors.dart2js');
6 6
7 #import('../../compiler/compiler.dart', prefix: 'diagnostics'); 7 #import('../../compiler/compiler.dart', prefix: 'diagnostics');
8 #import('../../compiler/implementation/elements/elements.dart'); 8 #import('../../compiler/implementation/elements/elements.dart');
9 #import('../../compiler/implementation/apiimpl.dart', prefix: 'api'); 9 #import('../../compiler/implementation/apiimpl.dart', prefix: 'api');
10 #import('../../compiler/implementation/scanner/scannerlib.dart'); 10 #import('../../compiler/implementation/scanner/scannerlib.dart');
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 /** 479 /**
480 * Returns the library name (for libraries with a #library tag) or the script 480 * Returns the library name (for libraries with a #library tag) or the script
481 * file name (for scripts without a #library tag). The latter case is used to 481 * file name (for scripts without a #library tag). The latter case is used to
482 * provide a 'library name' for scripts, to use for instance in dartdoc. 482 * provide a 'library name' for scripts, to use for instance in dartdoc.
483 */ 483 */
484 String get simpleName() { 484 String get simpleName() {
485 if (_library.libraryTag !== null) { 485 if (_library.libraryTag !== null) {
486 return _library.libraryTag.argument.dartString.slowToString(); 486 return _library.libraryTag.argument.dartString.slowToString();
487 } else { 487 } else {
488 // Use the file name as script name. 488 // Use the file name as script name.
489 String path = _library.uri.path; 489 String path = _library.script.uri.path;
490 return path.substring(path.lastIndexOf('/') + 1); 490 return path.substring(path.lastIndexOf('/') + 1);
491 } 491 }
492 } 492 }
493 493
494 String get qualifiedName() => simpleName; 494 String get qualifiedName() => simpleName;
495 495
496 void _ensureTypes() { 496 void _ensureTypes() {
497 if (_types == null) { 497 if (_types == null) {
498 _types = <InterfaceMirror>{}; 498 _types = <InterfaceMirror>{};
499 _library.forEachExport((Element e) { 499 _library.forEachExport((Element e) {
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 var span = system.compiler.spanFromNode(node, script.uri); 677 var span = system.compiler.spanFromNode(node, script.uri);
678 return new Dart2JsLocation(script, span); 678 return new Dart2JsLocation(script, span);
679 } 679 }
680 } 680 }
681 return super.location; 681 return super.location;
682 } 682 }
683 683
684 void _ensureMembers() { 684 void _ensureMembers() {
685 if (_members == null) { 685 if (_members == null) {
686 _members = <Dart2JsMemberMirror>{}; 686 _members = <Dart2JsMemberMirror>{};
687 _class.localMembers.forEach((e) { 687 _class.constructors.forEach((_, e) {
688 for (var member in _convertElementMemberToMemberMirrors(this, e)) { 688 for (var member in _convertElementMemberToMemberMirrors(this, e)) {
689 _members[member.canonicalName] = member; 689 _members[member.canonicalName] = member;
690 } 690 }
691 });
692 _class.localMembers.forEach((_, e) {
693 for (var member in _convertElementMemberToMemberMirrors(this, e)) {
694 _members[member.canonicalName] = member;
695 }
691 }); 696 });
692 } 697 }
693 } 698 }
694 699
695 Map<Object, MemberMirror> get declaredMembers() { 700 Map<Object, MemberMirror> get declaredMembers() {
696 _ensureMembers(); 701 _ensureMembers();
697 return new ImmutableMapWrapper<Object, MemberMirror>(_members); 702 return new ImmutableMapWrapper<Object, MemberMirror>(_members);
698 } 703 }
699 704
700 bool get isObject() => _class == system.compiler.objectClass; 705 bool get isObject() => _class == system.compiler.objectClass;
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
1355 if (node !== null) { 1360 if (node !== null) {
1356 var span = system.compiler.spanFromNode(node, script.uri); 1361 var span = system.compiler.spanFromNode(node, script.uri);
1357 return new Dart2JsLocation(script, span); 1362 return new Dart2JsLocation(script, span);
1358 } else { 1363 } else {
1359 var span = system.compiler.spanFromElement(_variable); 1364 var span = system.compiler.spanFromElement(_variable);
1360 return new Dart2JsLocation(script, span); 1365 return new Dart2JsLocation(script, span);
1361 } 1366 }
1362 } 1367 }
1363 } 1368 }
1364 1369
OLDNEW
« no previous file with comments | « lib/compiler/implementation/scanner/scanner_task.dart ('k') | tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698