| OLD | NEW |
| 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 @native("*A") | 5 @native("*A") |
| 6 class A { | 6 class A { |
| 7 } | 7 } |
| 8 | 8 |
| 9 @native makeA(); | 9 @native makeA(); |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class C { | 22 class C { |
| 23 // By having two 'foo' defined in the application, Frog will mangle | 23 // By having two 'foo' defined in the application, Frog will mangle |
| 24 // all calls to 'foo', which makes this test pass. | 24 // all calls to 'foo', which makes this test pass. |
| 25 foo(x) { return 43; } | 25 foo(x) { return 43; } |
| 26 } | 26 } |
| 27 | 27 |
| 28 typedContext() { | 28 typedContext() { |
| 29 var things = [ makeA(), new B() ]; | 29 var things = [ makeA(), new B() ]; |
| 30 A a = things[0]; | 30 A a = things[0]; |
| 31 Expect.throws(() => a.foo(), | 31 Expect.throws(() => a.foo(), |
| 32 (e) => e is NoSuchMethodException); | 32 (e) => e is NoSuchMethodError); |
| 33 Expect.throws(() => a.foo, | 33 Expect.throws(() => a.foo, |
| 34 (e) => e is NoSuchMethodException); | 34 (e) => e is NoSuchMethodError); |
| 35 Expect.throws(() => a.foo = 4, | 35 Expect.throws(() => a.foo = 4, |
| 36 (e) => e is NoSuchMethodException); | 36 (e) => e is NoSuchMethodError); |
| 37 } | 37 } |
| 38 | 38 |
| 39 untypedContext() { | 39 untypedContext() { |
| 40 var things = [ makeA(), new B() ]; | 40 var things = [ makeA(), new B() ]; |
| 41 var a = things[0]; | 41 var a = things[0]; |
| 42 Expect.throws(() => a.foo(), | 42 Expect.throws(() => a.foo(), |
| 43 (e) => e is NoSuchMethodException); | 43 (e) => e is NoSuchMethodError); |
| 44 Expect.throws(() => a.foo, | 44 Expect.throws(() => a.foo, |
| 45 (e) => e is NoSuchMethodException); | 45 (e) => e is NoSuchMethodError); |
| 46 Expect.throws(() => a.foo = 4, | 46 Expect.throws(() => a.foo = 4, |
| 47 (e) => e is NoSuchMethodException); | 47 (e) => e is NoSuchMethodError); |
| 48 } | 48 } |
| 49 | 49 |
| 50 main() { | 50 main() { |
| 51 setup(); | 51 setup(); |
| 52 typedContext(); | 52 typedContext(); |
| 53 untypedContext(); | 53 untypedContext(); |
| 54 } | 54 } |
| OLD | NEW |