| OLD | NEW |
| 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 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
| 6 import "package:async_helper/async_helper.dart"; | 6 import "package:async_helper/async_helper.dart"; |
| 7 import 'package:compiler/src/mirrors/source_mirrors.dart'; | 7 import 'package:compiler/src/mirrors/source_mirrors.dart'; |
| 8 import 'package:compiler/src/mirrors/mirrors_util.dart'; | 8 import 'package:compiler/src/mirrors/mirrors_util.dart'; |
| 9 import 'package:compiler/src/mirrors/analyze.dart'; | 9 import 'package:compiler/src/mirrors/analyze.dart'; |
| 10 import 'package:compiler/src/filenames.dart' | 10 import 'package:compiler/src/filenames.dart' |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 for (DeclarationMirror mirror in list) { | 36 for (DeclarationMirror mirror in list) { |
| 37 if (mirror.simpleName == name) { | 37 if (mirror.simpleName == name) { |
| 38 return mirror; | 38 return mirror; |
| 39 } | 39 } |
| 40 } | 40 } |
| 41 return null; | 41 return null; |
| 42 } | 42 } |
| 43 | 43 |
| 44 main() { | 44 main() { |
| 45 Uri scriptUri = currentDirectory.resolveUri(Platform.script); | 45 Uri scriptUri = currentDirectory.resolveUri(Platform.script); |
| 46 Uri packageRoot = scriptUri.resolve('./packages/'); | 46 Uri packageRoot = scriptUri.resolve('../packages/'); |
| 47 Uri libUri = scriptUri.resolve('../../../sdk/'); | 47 Uri libUri = scriptUri.resolve('../../../../sdk/'); |
| 48 Uri inputUri = scriptUri.resolve('mirrors_helper.dart'); | 48 Uri inputUri = scriptUri.resolve('../data/mirrors_helper.dart'); |
| 49 var provider = new CompilerSourceFileProvider(); | 49 var provider = new CompilerSourceFileProvider(); |
| 50 var diagnosticHandler = new FormattingDiagnosticHandler(provider); | 50 var diagnosticHandler = new FormattingDiagnosticHandler(provider); |
| 51 asyncStart(); | 51 asyncStart(); |
| 52 var result = analyze([inputUri], libUri, packageRoot, | 52 var result = analyze([inputUri], libUri, packageRoot, |
| 53 provider.readStringFromUri, diagnosticHandler, | 53 provider.readStringFromUri, diagnosticHandler, |
| 54 <String>['--preserve-comments']); | 54 <String>['--preserve-comments']); |
| 55 result.then((MirrorSystem mirrors) { | 55 result.then((MirrorSystem mirrors) { |
| 56 test(mirrors); | 56 test(mirrors); |
| 57 }).then(asyncSuccess); | 57 }).then(asyncSuccess); |
| 58 } | 58 } |
| (...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 Expect.isTrue(privateFactoryConstructor.isPrivate); | 965 Expect.isTrue(privateFactoryConstructor.isPrivate); |
| 966 Expect.isFalse(privateFactoryConstructor.isConstConstructor); | 966 Expect.isFalse(privateFactoryConstructor.isConstConstructor); |
| 967 Expect.isFalse(privateFactoryConstructor.isRedirectingConstructor); | 967 Expect.isFalse(privateFactoryConstructor.isRedirectingConstructor); |
| 968 Expect.isFalse(privateFactoryConstructor.isGenerativeConstructor); | 968 Expect.isFalse(privateFactoryConstructor.isGenerativeConstructor); |
| 969 Expect.isTrue(privateFactoryConstructor.isFactoryConstructor); | 969 Expect.isTrue(privateFactoryConstructor.isFactoryConstructor); |
| 970 | 970 |
| 971 var metadata = privateClass.metadata; | 971 var metadata = privateClass.metadata; |
| 972 Expect.isNotNull(metadata); | 972 Expect.isNotNull(metadata); |
| 973 Expect.equals(0, metadata.length); | 973 Expect.equals(0, metadata.length); |
| 974 } | 974 } |
| OLD | NEW |