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

Unified Diff: sdk/lib/_internal/compiler/samples/darttags/darttags.dart

Issue 119913002: Align source mirrors with runtime mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments + small fix. Created 6 years, 11 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
Index: sdk/lib/_internal/compiler/samples/darttags/darttags.dart
diff --git a/sdk/lib/_internal/compiler/samples/darttags/darttags.dart b/sdk/lib/_internal/compiler/samples/darttags/darttags.dart
index 752c0e03379a3a86cbc55a61b2e629ba45fda14e..3a00fc6588cea99f34d6356848c1f96b8ef9cb03 100644
--- a/sdk/lib/_internal/compiler/samples/darttags/darttags.dart
+++ b/sdk/lib/_internal/compiler/samples/darttags/darttags.dart
@@ -25,14 +25,16 @@
import 'dart:io';
-// TODO(ahe): Should be dart:mirrors.
-import '../../implementation/mirrors/mirrors.dart';
+import 'dart:mirrors';
import '../../../libraries.dart'
show LIBRARIES, LibraryInfo;
-import '../../implementation/mirrors/dart2js_mirror.dart'
- show analyze, BackDoor;
+import '../../implementation/mirrors/analyze.dart'
+ show analyze;
+import '../../implementation/mirrors/dart2js_mirrors.dart'
+ show BackDoor;
+import '../../implementation/mirrors/mirrors_util.dart' show nameOf;
import '../../implementation/filenames.dart';
import '../../implementation/source_file.dart';
@@ -40,7 +42,7 @@ import '../../implementation/source_file_provider.dart';
import '../../implementation/util/uri_extras.dart';
const DART2JS = '../../implementation/dart2js.dart';
-const DART2JS_MIRROR = '../../implementation/mirrors/dart2js_mirror.dart';
+const DART2JS_MIRROR = '../../implementation/mirrors/dart2js_mirrors.dart';
const SDK_ROOT = '../../../../../';
bool isPublicDart2jsLibrary(String name) {
@@ -106,9 +108,9 @@ emitTagsForCompilationUnit(compilationUnit) {
var buffer = new StringBuffer();
SourceFile file = handler.provider.sourceFiles['$uri'];
- compilationUnit.members.forEach((DeclarationMirror mirror) {
- var tagname = mirror.simpleName;
- var byte_offset = mirror.getBeginToken().charOffset;
+ compilationUnit.declarations.forEach((_, DeclarationMirror mirror) {
+ var tagname = nameOf(mirror);
+ var byte_offset = mirror.location.offset;
var line_number = file.getLine(byte_offset) + 1;
var lineStart = file.lineStarts[line_number - 1];
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/mirrors/util.dart ('k') | sdk/lib/_internal/compiler/samples/jsonify/jsonify.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698