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

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

Issue 1005873009: Fix check for throwing NSM implementations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | « pkg/compiler/lib/src/js_backend/no_such_method_registry.dart ('k') | no next file » | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 "package:async_helper/async_helper.dart"; 6 import "package:async_helper/async_helper.dart";
7 import 'compiler_helper.dart'; 7 import 'compiler_helper.dart';
8 8
9 dummyImplTest() { 9 dummyImplTest() {
10 String source = """ 10 String source = """
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 var compiler = compilerFor(source, uri); 202 var compiler = compilerFor(source, uri);
203 asyncTest(() => compiler.runCompiler(uri).then((_) { 203 asyncTest(() => compiler.runCompiler(uri).then((_) {
204 Expect.isTrue(compiler.backend.enabledNoSuchMethod); 204 Expect.isTrue(compiler.backend.enabledNoSuchMethod);
205 ClassElement clsA = findElement(compiler, 'A'); 205 ClassElement clsA = findElement(compiler, 'A');
206 Expect.isTrue( 206 Expect.isTrue(
207 compiler.backend.noSuchMethodRegistry.otherImpls.contains( 207 compiler.backend.noSuchMethodRegistry.otherImpls.contains(
208 clsA.lookupMember('noSuchMethod'))); 208 clsA.lookupMember('noSuchMethod')));
209 })); 209 }));
210 } 210 }
211 211
212 dummyImplTest10() {
213 String source = """
214 class A {
215 noSuchMethod(Invocation x) {
216 throw new UnsupportedException();
217 }
218 }
219 main() {
220 print(new A().foo());
221 }
222 """;
223 Uri uri = new Uri(scheme: 'source');
224 var compiler = compilerFor(source, uri);
225 asyncTest(() => compiler.runCompiler(uri).then((_) {
226 Expect.isTrue(compiler.backend.enabledNoSuchMethod);
227 ClassElement clsA = findElement(compiler, 'A');
228 Expect.isTrue(
229 compiler.backend.noSuchMethodRegistry.throwingImpls.contains(
230 clsA.lookupMember('noSuchMethod')));
231 }));
232 }
233
212 main() { 234 main() {
213 dummyImplTest(); 235 dummyImplTest();
214 dummyImplTest2(); 236 dummyImplTest2();
215 dummyImplTest3(); 237 dummyImplTest3();
216 dummyImplTest4(); 238 dummyImplTest4();
217 dummyImplTest5(); 239 dummyImplTest5();
218 dummyImplTest6(); 240 dummyImplTest6();
219 dummyImplTest7(); 241 dummyImplTest7();
220 dummyImplTest8(); 242 dummyImplTest8();
221 dummyImplTest9(); 243 dummyImplTest9();
244 dummyImplTest10();
222 } 245 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/no_such_method_registry.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698