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

Side by Side Diff: dart/tests/compiler/dart2js_foreign/native_checked_arguments1_test.dart

Issue 11293272: Update dart2js_foreign suite as we now validate annotations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 1 month 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) 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 // Test that type checks occur on native methods. 5 // Test that type checks occur on native methods.
6 6
7 @native("*A") 7 import 'native_metadata.dart';
8
9 @Native("*A")
8 class A { 10 class A {
9 @native int foo(int x); 11 @native int foo(int x);
10 @native int cmp(A other); 12 @native int cmp(A other);
11 } 13 }
12 14
13 @native("*B") 15 @Native("*B")
14 class B { 16 class B {
15 @native String foo(String x); 17 @native String foo(String x);
16 @native int cmp(B other); 18 @native int cmp(B other);
17 } 19 }
18 20
19 @native A makeA() { return new A(); } 21 @native A makeA() { return new A(); }
20 @native B makeB() { return new B(); } 22 @native B makeB() { return new B(); }
21 23
22 @native(""" 24 @Native("""
23 function A() {} 25 function A() {}
24 A.prototype.foo = function (x) { return x + 1; }; 26 A.prototype.foo = function (x) { return x + 1; };
25 A.prototype.cmp = function (x) { return 0; }; 27 A.prototype.cmp = function (x) { return 0; };
26 28
27 function B() {} 29 function B() {}
28 B.prototype.foo = function (x) { return x + 'ha!'; }; 30 B.prototype.foo = function (x) { return x + 'ha!'; };
29 B.prototype.cmp = function (x) { return 1; }; 31 B.prototype.cmp = function (x) { return 1; };
30 32
31 makeA = function(){return new A;}; 33 makeA = function(){return new A;};
32 makeB = function(){return new B;}; 34 makeB = function(){return new B;};
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 136
135 main() { 137 main() {
136 setup(); 138 setup();
137 139
138 if (isCheckedMode()) { 140 if (isCheckedMode()) {
139 checkedModeTest(); 141 checkedModeTest();
140 } else { 142 } else {
141 uncheckedModeTest(); 143 uncheckedModeTest();
142 } 144 }
143 } 145 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698