OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 // Regression test for Issue 9182. The generative constructor body function | 5 // Regression test for Issue 9182. The generative constructor body function |
6 // should not have the interceptor calling convention. | 6 // should not have the interceptor calling convention. |
7 | 7 |
8 import "native_testing.dart"; | 8 import "native_testing.dart"; |
9 | 9 |
10 @Native("A") | 10 @Native("A") |
(...skipping 12 matching lines...) Expand all Loading... |
23 _y = y; | 23 _y = y; |
24 } | 24 } |
25 } | 25 } |
26 | 26 |
27 void setup() native r""" | 27 void setup() native r""" |
28 function A(){} | 28 function A(){} |
29 makeA = function() { return new A; }; | 29 makeA = function() { return new A; }; |
30 self.nativeConstructor(A); | 30 self.nativeConstructor(A); |
31 """; | 31 """; |
32 | 32 |
33 makeA() native ; | 33 makeA() native; |
34 | 34 |
35 main() { | 35 main() { |
36 nativeTesting(); | 36 nativeTesting(); |
37 setup(); | 37 setup(); |
38 | 38 |
39 var foo = confuse(new Foo()); | 39 var foo = confuse(new Foo()); |
40 var bar = confuse(new Bar(30, 40)); | 40 var bar = confuse(new Bar(30, 40)); |
41 | 41 |
42 Expect.equals(123, foo.Bar()); // Ensure that Foo.Bar is used. | 42 Expect.equals(123, foo.Bar()); // Ensure that Foo.Bar is used. |
43 | 43 |
44 Expect.equals(30, bar._x); | 44 Expect.equals(30, bar._x); |
45 Expect.equals(40, bar._y); | 45 Expect.equals(40, bar._y); |
46 } | 46 } |
OLD | NEW |