OLD | NEW |
---|---|
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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:_js_helper"; | 5 import "dart:_js_helper"; |
6 import 'dart:_foreign_helper' show JS; | |
Johnni Winther
2014/07/25 06:37:06
Not needed (yet), right?
| |
6 import "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
7 | 8 |
8 makeCC() native; | 9 makeCC() native; |
9 | 10 |
10 void setup() native """ | 11 void setup() native """ |
11 function CC() {} | 12 function CC() {} |
12 makeCC = function() { return new CC; } | 13 makeCC = function() { return new CC; } |
13 """; | 14 """; |
14 | 15 |
15 | 16 |
(...skipping 17 matching lines...) Expand all Loading... | |
33 } | 34 } |
34 | 35 |
35 main() { | 36 main() { |
36 setup(); | 37 setup(); |
37 var c = makeCC(); | 38 var c = makeCC(); |
38 c.init(); | 39 c.init(); |
39 // `foo` contains a closure. Make sure that invoking foo through an | 40 // `foo` contains a closure. Make sure that invoking foo through an |
40 // interceptor works. | 41 // interceptor works. |
41 Expect.equals("### !!! 499 !!! ###", c.foo(499)); | 42 Expect.equals("### !!! 499 !!! ###", c.foo(499)); |
42 } | 43 } |
OLD | NEW |