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

Side by Side Diff: tests/compiler/dart2js/patch_test.dart

Issue 40583002: Incorporates feedback by Nicolas for UTF-8 bytes based scanner CL (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/compiler/dart2js/mock_compiler.dart ('k') | tests/compiler/dart2js/resolver_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart"; 8 import "../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart";
9 import "../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar t"; 9 import "../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar t";
10 import "../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart"; 10 import "../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart";
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 ensure(compiler, "method", cls.patch.lookupLocalMember, 729 ensure(compiler, "method", cls.patch.lookupLocalMember,
730 checkHasBody: true, expectIsRegular: true); 730 checkHasBody: true, expectIsRegular: true);
731 731
732 ensure(compiler, "clear", cls.lookupLocalMember, 732 ensure(compiler, "clear", cls.lookupLocalMember,
733 checkHasBody: true, expectIsPatched: true); 733 checkHasBody: true, expectIsPatched: true);
734 734
735 compiler.phase = Compiler.PHASE_DONE_RESOLVING; 735 compiler.phase = Compiler.PHASE_DONE_RESOLVING;
736 736
737 // Check that a method just in the patch class is a target for a 737 // Check that a method just in the patch class is a target for a
738 // typed selector. 738 // typed selector.
739 var selector = new Selector.call( 739 var selector = new Selector.call('method', compiler.coreLibrary, 0);
740 'method', compiler.coreLibrary, 0);
741 var typedSelector = new TypedSelector.exact(cls, selector); 740 var typedSelector = new TypedSelector.exact(cls, selector);
742 Element method = 741 Element method = cls.implementation.lookupLocalMember('method');
743 cls.implementation.lookupLocalMember('method');
744 Expect.isTrue(selector.applies(method, compiler)); 742 Expect.isTrue(selector.applies(method, compiler));
745 Expect.isTrue(typedSelector.applies(method, compiler)); 743 Expect.isTrue(typedSelector.applies(method, compiler));
746 744
747 // Check that the declaration method in the declaration class is a target 745 // Check that the declaration method in the declaration class is a target
748 // for a typed selector. 746 // for a typed selector.
749 selector = new Selector.call( 747 selector = new Selector.call('clear', compiler.coreLibrary, 0);
750 'clear', compiler.coreLibrary, 0);
751 typedSelector = new TypedSelector.exact(cls, selector); 748 typedSelector = new TypedSelector.exact(cls, selector);
752 method = cls.lookupLocalMember('clear'); 749 method = cls.lookupLocalMember('clear');
753 Expect.isTrue(selector.applies(method, compiler)); 750 Expect.isTrue(selector.applies(method, compiler));
754 Expect.isTrue(typedSelector.applies(method, compiler)); 751 Expect.isTrue(typedSelector.applies(method, compiler));
755 752
756 // Check that the declaration method in the declaration class is a target 753 // Check that the declaration method in the declaration class is a target
757 // for a typed selector on a subclass. 754 // for a typed selector on a subclass.
758 cls = ensure(compiler, "B", compiler.coreLibrary.find); 755 cls = ensure(compiler, "B", compiler.coreLibrary.find);
759 cls.ensureResolved(compiler); 756 cls.ensureResolved(compiler);
760 typedSelector = new TypedSelector.exact(cls, selector); 757 typedSelector = new TypedSelector.exact(cls, selector);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 testPatchNoGetter(); 837 testPatchNoGetter();
841 testPatchNonSetter(); 838 testPatchNonSetter();
842 testPatchNoSetter(); 839 testPatchNoSetter();
843 testPatchNonFunction(); 840 testPatchNonFunction();
844 841
845 testPatchAndSelector(); 842 testPatchAndSelector();
846 843
847 testAnalyzeAllInjectedMembers(); 844 testAnalyzeAllInjectedMembers();
848 testTypecheckPatchedMembers(); 845 testTypecheckPatchedMembers();
849 } 846 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/mock_compiler.dart ('k') | tests/compiler/dart2js/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698