OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 // VMOptions=-DUSE_CPS_IR=true | 4 // VMOptions=-DUSE_CPS_IR=true |
5 | 5 |
6 // Tests of interceptors. | 6 // Tests of interceptors. |
7 | 7 |
8 library constructor_test; | 8 library constructor_test; |
9 | 9 |
10 import 'js_backend_cps_ir.dart'; | 10 import 'js_backend_cps_ir.dart'; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 print(x); | 63 print(x); |
64 } | 64 } |
65 } | 65 } |
66 main() { | 66 main() { |
67 print(new Sub(1, 2).x); | 67 print(new Sub(1, 2).x); |
68 }""", | 68 }""", |
69 r""" | 69 r""" |
70 function(x, y) { | 70 function(x, y) { |
71 var v0; | 71 var v0; |
72 v0 = new V.Sub(y, x); | 72 v0 = new V.Sub(y, x); |
73 v0.Base0$0(); | 73 v0.Base0(); |
74 v0.Sub$2(x, y); | 74 v0.Sub(x, y); |
75 return v0; | 75 return v0; |
76 }"""), | 76 }"""), |
77 | 77 |
78 const TestEntry.forMethod('generative_constructor(Sub#)', """ | 78 const TestEntry.forMethod('generative_constructor(Sub#)', """ |
79 class Base0 { | 79 class Base0 { |
80 Base0() { | 80 Base0() { |
81 print('Base0'); | 81 print('Base0'); |
82 } | 82 } |
83 } | 83 } |
84 class Base extends Base0 { | 84 class Base extends Base0 { |
(...skipping 10 matching lines...) Expand all Loading... |
95 } | 95 } |
96 main() { | 96 main() { |
97 print(new Sub(1, 2).x); | 97 print(new Sub(1, 2).x); |
98 }""", | 98 }""", |
99 r""" | 99 r""" |
100 function(x, y) { | 100 function(x, y) { |
101 var box_0, v0; | 101 var box_0, v0; |
102 box_0 = {}; | 102 box_0 = {}; |
103 box_0.x1_0 = x; | 103 box_0.x1_0 = x; |
104 v0 = new V.Sub(y, new V.Base_closure(box_0)); | 104 v0 = new V.Sub(y, new V.Base_closure(box_0)); |
105 v0.Base0$0(); | 105 v0.Base0(); |
106 v0.Base$1(box_0); | 106 v0.Base(box_0); |
107 v0.Sub$2(x, y); | 107 v0.Sub(x, y); |
108 return v0; | 108 return v0; |
109 }"""), | 109 }"""), |
110 | 110 |
111 const TestEntry.forMethod('generative_constructor(Sub#)', """ | 111 const TestEntry.forMethod('generative_constructor(Sub#)', """ |
112 foo(x) { | 112 foo(x) { |
113 print(x); | 113 print(x); |
114 } | 114 } |
115 class Base { | 115 class Base { |
116 var x1 = foo('x1'); | 116 var x1 = foo('x1'); |
117 var x2; | 117 var x2; |
(...skipping 18 matching lines...) Expand all Loading... |
136 v2 = V.foo("x1"); | 136 v2 = V.foo("x1"); |
137 v3 = V.foo("x3"); | 137 v3 = V.foo("x3"); |
138 v4 = V.foo("x2"); | 138 v4 = V.foo("x2"); |
139 return new V.Sub(v0, v1, V.foo("y3"), v2, v4, v3); | 139 return new V.Sub(v0, v1, V.foo("y3"), v2, v4, v3); |
140 }"""), | 140 }"""), |
141 ]; | 141 ]; |
142 | 142 |
143 void main() { | 143 void main() { |
144 runTests(tests); | 144 runTests(tests); |
145 } | 145 } |
OLD | NEW |