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

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

Issue 2345083003: dart2js: run dartfmt on tests (Closed)
Patch Set: Created 4 years, 3 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
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, [z]) => "foo"; 10 foo(x, y, [z]) => "foo";
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 @Native("A") 15 @Native("A")
16 class A { 16 class A {
17 bar() => 42; 17 bar() => 42;
18 } 18 }
19 19
20 @Native("B") 20 @Native("B")
21 class B { 21 class B {
22 foo() => 42; 22 foo() => 42;
23 } 23 }
24 24
25 class C { 25 class C {
26 static create() => new C(); 26 static create() => new C();
27 noSuchMethod(x) => "${getName(x)}:${x.positionalArguments}"; 27 noSuchMethod(x) => "${getName(x)}:${x.positionalArguments}";
28 } 28 }
29 29
30 makeA() native; 30 makeA() native ;
31 31
32 setup() native """ 32 setup() native """
33 function A() {} 33 function A() {}
34 makeA = function() { return new A; } 34 makeA = function() { return new A; }
35 """; 35 """;
36 36
37 main() { 37 main() {
38 setup(); 38 setup();
39 var a = makeA(); 39 var a = makeA();
40 a.bar(); 40 a.bar();
41 var exception; 41 var exception;
42 try { 42 try {
43 a.foo(); 43 a.foo();
44 } on NoSuchMethodError catch (e) { 44 } on NoSuchMethodError catch (e) {
45 exception = e; 45 exception = e;
46 } 46 }
47 Expect.isNotNull(exception); 47 Expect.isNotNull(exception);
48 var c = C.create(); 48 var c = C.create();
49 Expect.equals("foo:[1, 2]", c.foo(1, 2)); 49 Expect.equals("foo:[1, 2]", c.foo(1, 2));
50 Expect.equals("foo:[3, 4, 5]", c.foo(3, 4, 5)); 50 Expect.equals("foo:[3, 4, 5]", c.foo(3, 4, 5));
51 } 51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698