OLD | NEW |
1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 import 'package:expect/expect.dart'; | 5 import 'package:expect/expect.dart'; |
6 | 6 |
7 class Goo { | 7 class Goo { |
8 static bar(a) { | 8 static bar(a) { |
9 return a is String; | 9 return a is String; |
10 } | 10 } |
11 } | 11 } |
12 | 12 |
13 class Zoo { | 13 class Zoo { |
14 bar(a) { | 14 bar(a) { |
15 return a is String; | 15 return a is String; |
16 } | 16 } |
17 } | 17 } |
18 | 18 |
19 function bar(a) { | 19 function bar(a) { |
20 return a is! String; | 20 return a is! String; |
21 } | 21 } |
22 | 22 |
23 int main() { | 23 int main() { |
24 var gBar_tearOff = Goo.bar.call; | 24 var gBar_tearOff = Goo.bar.call; |
25 Expect.isFalse(gBar_tearOff.call(1)); | 25 Expect.isFalse(gBar_tearOff.call(1)); |
26 var zBar_tearOff = new Zoo().bar.call; | 26 var zBar_tearOff = new Zoo().bar.call; |
27 Expect.isFalse(zBar_tearOff.call(1)); | 27 Expect.isFalse(zBar_tearOff.call(1)); |
28 var bar_tearOff = bar.call; | 28 var bar_tearOff = bar.call; |
29 Expect.isTrue(bar_tearOff.call(1)); | 29 Expect.isTrue(bar_tearOff.call(1)); |
30 } | 30 } |
OLD | NEW |