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

Side by Side Diff: tests/compiler/dart2js_native/subclassing_5_test.dart

Issue 383413003: Add @Native(...) annotation for native class names. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 5 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 'dart:_js_helper' show Creates, setNativeSubclassDispatchRecord; 6 import 'dart:_js_helper' show Native, Creates, setNativeSubclassDispatchRecord;
7 import 'dart:_interceptors' show Interceptor, findInterceptorForType; 7 import 'dart:_interceptors' show Interceptor, findInterceptorForType;
8 8
9 // Test type checks. 9 // Test type checks.
10 10
11 class I {} 11 class I {}
12 12
13 class M implements I { 13 class M implements I {
14 miz() => 'M'; 14 miz() => 'M';
15 } 15 }
16 16
17 class N native "N" {} 17 @Native("N")
18 class N {}
18 19
19 class A extends N {} 20 class A extends N {}
20 21
21 class B extends A with M { 22 class B extends A with M {
22 } 23 }
23 24
24 class Checks<T> { 25 class Checks<T> {
25 bool isCheck(x) => x is T; 26 bool isCheck(x) => x is T;
26 void assignCheck(x) { 27 void assignCheck(x) {
27 T z = x; 28 T z = x;
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 inscrutable(new Checks<M>().assignCheck)(b); 168 inscrutable(new Checks<M>().assignCheck)(b);
168 inscrutable(new Checks<I>().assignCheck)(b); 169 inscrutable(new Checks<I>().assignCheck)(b);
169 170
170 inscrutable(new Checks<B>().castCheck)(b); 171 inscrutable(new Checks<B>().castCheck)(b);
171 inscrutable(new Checks<A>().castCheck)(b); 172 inscrutable(new Checks<A>().castCheck)(b);
172 inscrutable(new Checks<N>().castCheck)(b); 173 inscrutable(new Checks<N>().castCheck)(b);
173 inscrutable(new Checks<M>().castCheck)(b); 174 inscrutable(new Checks<M>().castCheck)(b);
174 inscrutable(new Checks<I>().castCheck)(b); 175 inscrutable(new Checks<I>().castCheck)(b);
175 } 176 }
176 } 177 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698