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

Side by Side Diff: tests/compiler/dart2js_native/subclassing_4_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 calling convention on subclasses of native classes. 9 // Test calling convention on subclasses of native classes.
10 10
11 class M { 11 class M {
12 miz() => 'M'; 12 miz() => 'M';
13 } 13 }
14 14
15 class N native "N" {} 15 @Native("N")
16 class N {}
16 17
17 class A extends N {} 18 class A extends N {}
18 19
19 class B extends A with M { 20 class B extends A with M {
20 // The call to [miz] has a know type [B]. The call is in an intercepted 21 // The call to [miz] has a know type [B]. The call is in an intercepted
21 // method and to an intercepted method, so the ambient interceptor can be 22 // method and to an intercepted method, so the ambient interceptor can be
22 // used. For correct optimization of the interceptor, the compiler needs to 23 // used. For correct optimization of the interceptor, the compiler needs to
23 // (1) correctly determine that B is an intercepted type (because it extends a 24 // (1) correctly determine that B is an intercepted type (because it extends a
24 // native class) and (2) realize that the intersection of [B] and subclasses 25 // native class) and (2) realize that the intersection of [B] and subclasses
25 // of mixin applications of [M] is non-empty. 26 // of mixin applications of [M] is non-empty.
(...skipping 12 matching lines...) Expand all
38 """; 39 """;
39 40
40 main() { 41 main() {
41 setup(); 42 setup();
42 43
43 setNativeSubclassDispatchRecord(getBPrototype(), findInterceptorForType(B)); 44 setNativeSubclassDispatchRecord(getBPrototype(), findInterceptorForType(B));
44 45
45 B b = makeB(); 46 B b = makeB();
46 Expect.equals('M', b.callMiz()); 47 Expect.equals('M', b.callMiz());
47 } 48 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js_native/subclassing_3_test.dart ('k') | tests/compiler/dart2js_native/subclassing_5_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698