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

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

Issue 11338031: Introduce DeclarationMirror (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 | « pkg/dartdoc/lib/mirrors.dart ('k') | tests/compiler/dart2js/mirrors_test.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) 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 'dart:io'; 7 import 'dart:io';
8 import 'dart:uri'; 8 import 'dart:uri';
9 9
10 import '../../../../../lib/compiler/compiler.dart' as diagnostics; 10 import '../../../../../lib/compiler/compiler.dart' as diagnostics;
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 377
378 378
379 //------------------------------------------------------------------------------ 379 //------------------------------------------------------------------------------
380 // Dart2Js specific extensions of mirror interfaces 380 // Dart2Js specific extensions of mirror interfaces
381 //------------------------------------------------------------------------------ 381 //------------------------------------------------------------------------------
382 382
383 abstract class Dart2JsMirror implements Mirror { 383 abstract class Dart2JsMirror implements Mirror {
384 Dart2JsMirrorSystem get system; 384 Dart2JsMirrorSystem get system;
385 } 385 }
386 386
387 abstract class Dart2JsMemberMirror implements Dart2JsMirror, MemberMirror { 387 abstract class Dart2JsDeclarationMirror
388 implements Dart2JsMirror, DeclarationMirror {
kasperl 2012/10/30 10:11:05 More indentation of implements for consistency?
Johnni Winther 2012/10/30 10:24:25 Done.
388 389
389 } 390 }
390 391
391 abstract class Dart2JsTypeMirror implements Dart2JsMirror, TypeMirror { 392 abstract class Dart2JsMemberMirror
393 implements Dart2JsDeclarationMirror, MemberMirror {
392 394
393 } 395 }
394 396
395 abstract class Dart2JsElementMirror implements Dart2JsMirror { 397 abstract class Dart2JsTypeMirror
398 implements Dart2JsDeclarationMirror, TypeMirror {
399
400 }
401
402 abstract class Dart2JsElementMirror implements Dart2JsDeclarationMirror {
396 final Dart2JsMirrorSystem system; 403 final Dart2JsMirrorSystem system;
397 final Element _element; 404 final Element _element;
398 405
399 Dart2JsElementMirror(this.system, this._element) { 406 Dart2JsElementMirror(this.system, this._element) {
400 assert (system !== null); 407 assert (system !== null);
401 assert (_element !== null); 408 assert (_element !== null);
402 } 409 }
403 410
404 String get simpleName => _element.name.slowToString(); 411 String get simpleName => _element.name.slowToString();
405 412
406 String get displayName => simpleName; 413 String get displayName => simpleName;
407 414
408 Location get location => new Dart2JsLocation( 415 Location get location => new Dart2JsLocation(
409 _element.getCompilationUnit().script, 416 _element.getCompilationUnit().script,
410 system.compiler.spanFromElement(_element)); 417 system.compiler.spanFromElement(_element));
411 418
412 String toString() => _element.toString(); 419 String toString() => _element.toString();
413 420
414 int get hashCode => qualifiedName.hashCode; 421 int get hashCode => qualifiedName.hashCode;
415 } 422 }
416 423
417 abstract class Dart2JsProxyMirror implements Dart2JsMirror { 424 abstract class Dart2JsProxyMirror implements Dart2JsDeclarationMirror {
418 final Dart2JsMirrorSystem system; 425 final Dart2JsMirrorSystem system;
419 426
420 Dart2JsProxyMirror(this.system); 427 Dart2JsProxyMirror(this.system);
421 428
422 String get displayName => simpleName; 429 String get displayName => simpleName;
423 430
424 int get hashCode => qualifiedName.hashCode; 431 int get hashCode => qualifiedName.hashCode;
425 } 432 }
426 433
427 //------------------------------------------------------------------------------ 434 //------------------------------------------------------------------------------
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after
1391 if (node !== null) { 1398 if (node !== null) {
1392 var span = system.compiler.spanFromNode(node, script.uri); 1399 var span = system.compiler.spanFromNode(node, script.uri);
1393 return new Dart2JsLocation(script, span); 1400 return new Dart2JsLocation(script, span);
1394 } else { 1401 } else {
1395 var span = system.compiler.spanFromElement(_variable); 1402 var span = system.compiler.spanFromElement(_variable);
1396 return new Dart2JsLocation(script, span); 1403 return new Dart2JsLocation(script, span);
1397 } 1404 }
1398 } 1405 }
1399 } 1406 }
1400 1407
OLDNEW
« no previous file with comments | « pkg/dartdoc/lib/mirrors.dart ('k') | tests/compiler/dart2js/mirrors_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698