| 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 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'package:expect/expect.dart'; | 6 import 'package:expect/expect.dart'; |
| 7 import 'package:async_helper/async_helper.dart'; | 7 import 'package:async_helper/async_helper.dart'; |
| 8 import 'package:compiler/src/compiler.dart'; | 8 import 'package:compiler/src/compiler.dart'; |
| 9 import 'package:compiler/src/diagnostics/messages.dart' show | 9 import 'package:compiler/src/diagnostics/messages.dart' show |
| 10 MessageKind; | 10 MessageKind; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 Expect.isNotNull(node.body); | 50 Expect.isNotNull(node.body); |
| 51 // If the element has a body it is either a Block or a Return statement, | 51 // If the element has a body it is either a Block or a Return statement, |
| 52 // both with different begin and end tokens. | 52 // both with different begin and end tokens. |
| 53 Expect.isTrue(node.body is Block || node.body is Return); | 53 Expect.isTrue(node.body is Block || node.body is Return); |
| 54 Expect.notEquals(node.body.getBeginToken(), node.body.getEndToken()); | 54 Expect.notEquals(node.body.getBeginToken(), node.body.getEndToken()); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void expectHasNoBody(compiler, ElementX element) { | 57 void expectHasNoBody(compiler, ElementX element) { |
| 58 var node = element.parseNode(compiler.parsing); | 58 var node = element.parseNode(compiler.parsing); |
| 59 Expect.isNotNull(node, "Element isn't parseable, when a body was expected"); | 59 Expect.isNotNull(node, "Element isn't parseable, when a body was expected"); |
| 60 Expect.isFalse(node.hasBody()); | 60 Expect.isFalse(node.hasBody); |
| 61 } | 61 } |
| 62 | 62 |
| 63 Element ensure(compiler, | 63 Element ensure(compiler, |
| 64 String name, | 64 String name, |
| 65 Element lookup(name), | 65 Element lookup(name), |
| 66 {bool expectIsPatched: false, | 66 {bool expectIsPatched: false, |
| 67 bool expectIsPatch: false, | 67 bool expectIsPatch: false, |
| 68 bool checkHasBody: false, | 68 bool checkHasBody: false, |
| 69 bool expectIsGetter: false, | 69 bool expectIsGetter: false, |
| 70 bool expectIsFound: true, | 70 bool expectIsFound: true, |
| (...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1110 await testPatchNonFunction(); | 1110 await testPatchNonFunction(); |
| 1111 | 1111 |
| 1112 await testPatchAndSelector(); | 1112 await testPatchAndSelector(); |
| 1113 | 1113 |
| 1114 await testEffectiveTarget(); | 1114 await testEffectiveTarget(); |
| 1115 | 1115 |
| 1116 await testAnalyzeAllInjectedMembers(); | 1116 await testAnalyzeAllInjectedMembers(); |
| 1117 await testTypecheckPatchedMembers(); | 1117 await testTypecheckPatchedMembers(); |
| 1118 }); | 1118 }); |
| 1119 } | 1119 } |
| OLD | NEW |