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

Unified Diff: pkg/docgen/lib/src/models/dummy_mirror.dart

Issue 1364553002: remove docgen source and targets from build (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: remove scripts Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/docgen/lib/src/models/doc_gen_type.dart ('k') | pkg/docgen/lib/src/models/generic.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/docgen/lib/src/models/dummy_mirror.dart
diff --git a/pkg/docgen/lib/src/models/dummy_mirror.dart b/pkg/docgen/lib/src/models/dummy_mirror.dart
deleted file mode 100644
index 9ad612a4804cdb36aaa1c8b829e65d1858bb5f6c..0000000000000000000000000000000000000000
--- a/pkg/docgen/lib/src/models/dummy_mirror.dart
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library docgen.models.dummy_mirror;
-
-import '../exports/mirrors_util.dart' as dart2js_util;
-import '../exports/source_mirrors.dart';
-
-import '../library_helpers.dart';
-
-import 'indexable.dart';
-import 'model_helpers.dart';
-
-/// For types that we do not explicitly create or have not yet created in our
-/// entity map (like core types).
-class DummyMirror implements Indexable {
- final DeclarationMirror mirror;
- /// The library that contains this element, if any. Used as a hint to help
- /// determine which object we're referring to when looking up this mirror in
- /// our map.
- final Indexable owner;
-
- DummyMirror(this.mirror, [this.owner]);
-
- String get docName {
- if (mirror is LibraryMirror) {
- return getLibraryDocName(mirror);
- }
- var mirrorOwner = mirror.owner;
- if (mirrorOwner == null) return dart2js_util.qualifiedNameOf(mirror);
- var simpleName = dart2js_util.nameOf(mirror);
- if (mirror is MethodMirror && (mirror as MethodMirror).isConstructor) {
- // We name constructors specially -- repeating the class name and a
- // "-" to separate the constructor from its name (if any).
- simpleName = '${dart2js_util.nameOf(mirrorOwner)}-$simpleName';
- }
- return getDocgenObject(mirrorOwner, owner).docName + '.' +
- simpleName;
- }
-
- bool get isPrivate => mirror.isPrivate;
-
- String get packageName {
- var libMirror = _getOwningLibraryFromMirror(mirror);
- if (libMirror != null) {
- return getPackageName(libMirror);
- }
- return '';
- }
-
- String get packagePrefix => packageName == null || packageName.isEmpty ?
- '' : '$packageName/';
-
- // This is a known incomplete implementation of Indexable
- // overriding noSuchMethod to remove static warnings
- noSuchMethod(Invocation invocation) {
- throw new UnimplementedError(invocation.memberName.toString());
- }
-}
-
-LibraryMirror _getOwningLibraryFromMirror(DeclarationMirror mirror) {
- if (mirror == null) return null;
- if (mirror is LibraryMirror) return mirror;
- return _getOwningLibraryFromMirror(mirror.owner);
-}
« no previous file with comments | « pkg/docgen/lib/src/models/doc_gen_type.dart ('k') | pkg/docgen/lib/src/models/generic.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698