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

Side by Side Diff: tests/compiler/dart2js_native/bound_closure_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 "dart:_js_helper";
5 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
6 7
7 // Test calling convention of property extraction closures. 8 // Test calling convention of property extraction closures.
8 9
9 class AA { 10 class AA {
10 bar(a, [b = 'A']) => 'AA.bar($a, $b)'; // bar is plain dart convention. 11 bar(a, [b = 'A']) => 'AA.bar($a, $b)'; // bar is plain dart convention.
11 foo(a, [b = 'A']) => 'AA.foo($a, $b)'; // foo has interceptor convention. 12 foo(a, [b = 'A']) => 'AA.foo($a, $b)'; // foo has interceptor convention.
12 } 13 }
13 14
14 class BB native "BB" { 15 @Native("BB")
16 class BB {
15 foo(a, [b = 'B']) native; 17 foo(a, [b = 'B']) native;
16 } 18 }
17 19
18 class CC extends BB native "CC" { 20 @Native("CC")
21 class CC extends BB {
19 foo(a, [b = 'C']) native; 22 foo(a, [b = 'C']) native;
20 23
21 get superfoo => super.foo; 24 get superfoo => super.foo;
22 } 25 }
23 26
24 makeBB() native; 27 makeBB() native;
25 makeCC() native; 28 makeCC() native;
26 inscrutable(a) native; 29 inscrutable(a) native;
27 30
28 void setup() native r""" 31 void setup() native r"""
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 73
71 Expect.equals('AA.foo(1, A)', afoo(1)); 74 Expect.equals('AA.foo(1, A)', afoo(1));
72 Expect.equals('AA.foo(2, 3)', afoo(2, 3)); 75 Expect.equals('AA.foo(2, 3)', afoo(2, 3));
73 76
74 Expect.equals('BB.foo(1, B)', bfoo(1)); 77 Expect.equals('BB.foo(1, B)', bfoo(1));
75 Expect.equals('BB.foo(2, 3)', bfoo(2, 3)); 78 Expect.equals('BB.foo(2, 3)', bfoo(2, 3));
76 79
77 Expect.equals('CC.foo(1, C)', cfoo(1)); 80 Expect.equals('CC.foo(1, C)', cfoo(1));
78 Expect.equals('CC.foo(2, 3)', cfoo(2, 3)); 81 Expect.equals('CC.foo(2, 3)', cfoo(2, 3));
79 } 82 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698