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 "../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart"; | 6 import "../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart"; |
7 import "../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar
t"; | 7 import "../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar
t"; |
8 import "../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart"; | 8 import "../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart"; |
9 import "../../../sdk/lib/_internal/compiler/implementation/util/util.dart"; | 9 import "../../../sdk/lib/_internal/compiler/implementation/util/util.dart"; |
10 import "mock_compiler.dart"; | 10 import "mock_compiler.dart"; |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 external var foo; | 499 external var foo; |
500 """, | 500 """, |
501 """ | 501 """ |
502 patch get foo => 0; | 502 patch get foo => 0; |
503 """); | 503 """); |
504 ensure(compiler, "foo", compiler.coreLibrary.find); | 504 ensure(compiler, "foo", compiler.coreLibrary.find); |
505 | 505 |
506 Expect.isTrue(compiler.warnings.isEmpty, | 506 Expect.isTrue(compiler.warnings.isEmpty, |
507 "Unexpected warnings: ${compiler.warnings}"); | 507 "Unexpected warnings: ${compiler.warnings}"); |
508 print('testPatchNonPatchableOrigin:${compiler.errors}'); | 508 print('testPatchNonPatchableOrigin:${compiler.errors}'); |
509 Expect.equals(1, compiler.errors.length); | 509 Expect.equals(2, compiler.errors.length); |
510 Expect.isTrue( | 510 Expect.equals( |
511 compiler.errors[0].message.kind == MessageKind.PATCH_NONPATCHABLE); | 511 MessageKind.EXTRANEOUS_MODIFIER, compiler.errors[0].message.kind); |
| 512 Expect.equals( |
| 513 // TODO(ahe): Eventually, this error should be removed as it will be |
| 514 // handled by the regular parser. |
| 515 MessageKind.PATCH_NONPATCHABLE, compiler.errors[1].message.kind); |
512 } | 516 } |
513 | 517 |
514 testPatchNonExternalTopLevel() { | 518 testPatchNonExternalTopLevel() { |
515 var compiler = applyPatch( | 519 var compiler = applyPatch( |
516 """ | 520 """ |
517 void foo() {} | 521 void foo() {} |
518 """, | 522 """, |
519 """ | 523 """ |
520 patch void foo() {} | 524 patch void foo() {} |
521 """); | 525 """); |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 testPatchNoGetter(); | 795 testPatchNoGetter(); |
792 testPatchNonSetter(); | 796 testPatchNonSetter(); |
793 testPatchNoSetter(); | 797 testPatchNoSetter(); |
794 testPatchNonFunction(); | 798 testPatchNonFunction(); |
795 | 799 |
796 testPatchAndSelector(); | 800 testPatchAndSelector(); |
797 | 801 |
798 testAnalyzeAllInjectedMembers(); | 802 testAnalyzeAllInjectedMembers(); |
799 testTypecheckPatchedMembers(); | 803 testTypecheckPatchedMembers(); |
800 } | 804 } |
OLD | NEW |