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

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

Issue 13973017: Revert "Revert "Allow multiple tags in native clause."" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 7 years, 8 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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:mirrors" show reflect; 5 import "dart:mirrors" show reflect;
6 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 7
8 class GetName { 8 class GetName {
9 foo(x, y) => "foo"; 9 foo(x, y) => "foo";
10 baz(x, y, z) => "baz"; 10 baz(x, y, z) => "baz";
11 } 11 }
12 12
13 String getName(im) => reflect(new GetName()).delegate(im);; 13 String getName(im) => reflect(new GetName()).delegate(im);;
14 14
15 class A native "*A" { 15 class A native "A" {
16 bar() => 42; 16 bar() => 42;
17 noSuchMethod(x) => "native(${getName(x)}:${x.positionalArguments})"; 17 noSuchMethod(x) => "native(${getName(x)}:${x.positionalArguments})";
18 } 18 }
19 19
20 class B native "*B" { 20 class B native "B" {
21 baz() => 42; 21 baz() => 42;
22 } 22 }
23 23
24 makeA() native; 24 makeA() native;
25 25
26 setup() native """ 26 setup() native """
27 function A() {} 27 function A() {}
28 makeA = function() { return new A; } 28 makeA = function() { return new A; }
29 """; 29 """;
30 30
31 main() { 31 main() {
32 setup(); 32 setup();
33 var a = makeA(); 33 var a = makeA();
34 a.bar(); 34 a.bar();
35 Expect.equals("native(foo:[1, 2])", a.foo(1, 2)); 35 Expect.equals("native(foo:[1, 2])", a.foo(1, 2));
36 Expect.equals("native(baz:[3, 4, 5])", a.baz(3, 4, 5)); 36 Expect.equals("native(baz:[3, 4, 5])", a.baz(3, 4, 5));
37 } 37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698