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

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

Issue 897243003: dart2js: remove (broken) support for nsm on native classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove whitespace Created 5 years, 10 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
« no previous file with comments | « tests/compiler/dart2js_native/dart2js_native.status ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "dart:_js_helper"; 6 import "dart:_js_helper";
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 8
9 class GetName { 9 class GetName {
10 foo(x, y) => "foo"; 10 foo(x, y) => "foo";
11 baz(x, y, z) => "baz"; 11 baz(x, y, z) => "baz";
12 } 12 }
13 13
14 String getName(im) => reflect(new GetName()).delegate(im);; 14 String getName(im) => reflect(new GetName()).delegate(im);
15 15
16 @Native("A") 16 @Native("A")
17 class A { 17 class A {
18 bar() => 42; 18 bar() => 42;
19 noSuchMethod(x) => "native(${getName(x)}:${x.positionalArguments})"; 19 noSuchMethod(x) => "native(${getName(x)}:${x.positionalArguments})";
20 } 20 }
21 21
22 @Native("B") 22 @Native("B")
23 class B { 23 class B {
24 baz() => 42; 24 baz() => 42;
25 } 25 }
26 26
27 makeA() native; 27 makeA() native;
28 28
29 setup() native """ 29 setup() native """
30 function A() {} 30 function A() {}
31 makeA = function() { return new A; } 31 makeA = function() { return new A; }
32 """; 32 """;
33 33
34 main() { 34 main() {
35 setup(); 35 setup();
36 var a = makeA(); 36 var a = makeA();
37 a.bar(); 37 a.bar();
38 Expect.equals("native(foo:[1, 2])", a.foo(1, 2)); 38 Expect.equals("native(foo:[1, 2])", a.foo(1, 2));
39 Expect.equals("native(baz:[3, 4, 5])", a.baz(3, 4, 5)); 39 Expect.equals("native(baz:[3, 4, 5])", a.baz(3, 4, 5));
40 } 40 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js_native/dart2js_native.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698