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

Side by Side Diff: frog/tests/native/src/NativeClassInheritance4FrogTest.dart

Issue 10092012: Fix issue 2358: dart methods on native classes must also check if the current prototype has the met… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 | « frog/tests/native/native.status ('k') | lib/compiler/implementation/native_emitter.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 // Additional Dart code may be 'placed on' hidden native classes. With 5 // Additional Dart code may be 'placed on' hidden native classes. With
6 // inheritance, the superclass method must not be reached by a call on the 6 // inheritance, the superclass method must not be reached by a call on the
7 // subclass. 7 // subclass.
8 8
9 class A native "*A" { 9 class A native "*A" {
10 var _field; 10 var _field;
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 Expect.equals(1, b._field); 112 Expect.equals(1, b._field);
113 Expect.equals(123, b._field2); 113 Expect.equals(123, b._field2);
114 Expect.equals(123, b.X); 114 Expect.equals(123, b.X);
115 Expect.equals(200, b.method(77)); 115 Expect.equals(200, b.method(77));
116 } 116 }
117 117
118 testAB_typed() { 118 testAB_typed() {
119 setup(); // Fresh constructors. 119 setup(); // Fresh constructors.
120 120
121 A a = makeA(); 121 A a = makeA();
122 B b = makeA(); 122 B b = makeB();
123 123
124 a.X = 100; 124 a.X = 100;
125 Expect.equals(100, a._field); 125 Expect.equals(100, a._field);
126 Expect.equals(100, a.X); 126 Expect.equals(100, a.X);
127 Expect.equals(150, a.method(50)); 127 Expect.equals(150, a.method(50));
128 128
129 b._field = 1; 129 b._field = 1;
130 b._field2 = 2; 130 b._field2 = 2;
131 b.X = 123; 131 b.X = 123;
132 Expect.equals(1, b._field); 132 Expect.equals(1, b._field);
133 Expect.equals(123, b._field2); 133 Expect.equals(123, b._field2);
134 Expect.equals(123, b.X); 134 Expect.equals(123, b.X);
135 Expect.equals(200, b.method(77)); 135 Expect.equals(200, b.method(77));
136 } 136 }
137 137
138 main() { 138 main() {
139 testBasicA_dynamic(); 139 testBasicA_dynamic();
140 testBasicA_typed(); 140 testBasicA_typed();
141 testBasicB_dynamic(); 141 testBasicB_dynamic();
142 testBasicB_typed(); 142 testBasicB_typed();
143 testAB_dynamic(); 143 testAB_dynamic();
144 testAB_typed(); 144 testAB_typed();
145 } 145 }
OLDNEW
« no previous file with comments | « frog/tests/native/native.status ('k') | lib/compiler/implementation/native_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698