| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 test.method_location; | 5 library test.method_location; |
| 6 | 6 |
| 7 import "dart:mirrors"; | 7 import "dart:mirrors"; |
| 8 import "package:expect/expect.dart"; | 8 import "package:expect/expect.dart"; |
| 9 | 9 |
| 10 part 'method_mirror_location_other.dart'; | 10 part 'method_mirror_location_other.dart'; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 Expect.equals(column, methodMirror.location.column, "column"); | 26 Expect.equals(column, methodMirror.location.column, "column"); |
| 27 } | 27 } |
| 28 | 28 |
| 29 class ClassInMainFile { | 29 class ClassInMainFile { |
| 30 | 30 |
| 31 ClassInMainFile(); | 31 ClassInMainFile(); |
| 32 | 32 |
| 33 method() {} | 33 method() {} |
| 34 } | 34 } |
| 35 | 35 |
| 36 topLevelInMainFile() {} | 36 void topLevelInMainFile() {} |
| 37 spaceIdentedInMainFile() {} | 37 spaceIdentedInMainFile() {} |
| 38 tabIdentedInMainFile() {} | 38 tabIdentedInMainFile() {} |
| 39 | 39 |
| 40 class HasImplicitConstructor {} | 40 class HasImplicitConstructor {} |
| 41 | 41 |
| 42 typedef bool Predicate(num n); | 42 typedef bool Predicate(num n); |
| 43 | 43 |
| 44 main() { | 44 main() { |
| 45 localFunction(x) { return x; } | 45 localFunction(x) { return x; } |
| 46 | 46 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 64 otherSuffix, 11, 3); | 64 otherSuffix, 11, 3); |
| 65 expectLocation(reflect(topLevelInOtherFile), otherSuffix, 14, 1); | 65 expectLocation(reflect(topLevelInOtherFile), otherSuffix, 14, 1); |
| 66 expectLocation(reflect(spaceIdentedInOtherFile), otherSuffix, 16, 3); | 66 expectLocation(reflect(spaceIdentedInOtherFile), otherSuffix, 16, 3); |
| 67 expectLocation(reflect(tabIdentedInOtherFile), otherSuffix, 18, 2); | 67 expectLocation(reflect(tabIdentedInOtherFile), otherSuffix, 18, 2); |
| 68 | 68 |
| 69 // Synthetic methods. | 69 // Synthetic methods. |
| 70 Expect.isNull(reflectClass(HasImplicitConstructor) | 70 Expect.isNull(reflectClass(HasImplicitConstructor) |
| 71 .declarations[#HasImplicitConstructor].location); | 71 .declarations[#HasImplicitConstructor].location); |
| 72 Expect.isNull((reflectType(Predicate) as TypedefMirror).referent.callMethod.lo
cation); | 72 Expect.isNull((reflectType(Predicate) as TypedefMirror).referent.callMethod.lo
cation); |
| 73 } | 73 } |
| OLD | NEW |