| 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 // VMOptions=-DUSE_CPS_IR=true | 4 // VMOptions=-DUSE_CPS_IR=true |
| 5 | 5 |
| 6 // Tests for basic functionality. | 6 // Tests for basic functionality. |
| 7 | 7 |
| 8 library basic_tests; | 8 library basic_tests; |
| 9 | 9 |
| 10 import 'js_backend_cps_ir.dart'; | 10 import 'js_backend_cps_ir.dart'; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 }"""), | 123 }"""), |
| 124 // Method invocation | 124 // Method invocation |
| 125 const TestEntry(""" | 125 const TestEntry(""" |
| 126 main() { | 126 main() { |
| 127 print(new DateTime.now().isBefore(new DateTime.now())); | 127 print(new DateTime.now().isBefore(new DateTime.now())); |
| 128 }""", r""" | 128 }""", r""" |
| 129 function() { | 129 function() { |
| 130 P.print(P.DateTime$now().isBefore$1(P.DateTime$now())); | 130 P.print(P.DateTime$now().isBefore$1(P.DateTime$now())); |
| 131 return null; | 131 return null; |
| 132 }"""), | 132 }"""), |
| 133 // Static calls |
| 134 const TestEntry(""" |
| 135 foo() { print(42); } |
| 136 main() { foo(); } |
| 137 """, r""" |
| 138 function() { |
| 139 V.foo(); |
| 140 return null; |
| 141 }"""), |
| 142 // Static getters |
| 143 const TestEntry(""" |
| 144 var foo = 42; |
| 145 main() { print(foo); } |
| 146 """, r""" |
| 147 function() { |
| 148 P.print($.foo); |
| 149 return null; |
| 150 }"""), |
| 151 const TestEntry(""" |
| 152 get foo { print(42); } |
| 153 main() { foo; } |
| 154 """, r""" |
| 155 function() { |
| 156 V.foo(); |
| 157 return null; |
| 158 }"""), |
| 159 // Static setters |
| 160 const TestEntry(""" |
| 161 var foo = 0; |
| 162 main() { print(foo = 42); } |
| 163 """, r""" |
| 164 function() { |
| 165 var v0; |
| 166 v0 = 42; |
| 167 $.foo = v0; |
| 168 P.print(v0); |
| 169 return null; |
| 170 }"""), |
| 171 const TestEntry(""" |
| 172 set foo(x) { print(x); } |
| 173 main() { foo = 42; } |
| 174 """, r""" |
| 175 function() { |
| 176 V.foo(42); |
| 177 return null; |
| 178 }""") |
| 133 ]; | 179 ]; |
| 134 | 180 |
| 135 | 181 |
| 136 void main() { | 182 void main() { |
| 137 runTests(tests); | 183 runTests(tests); |
| 138 } | 184 } |
| OLD | NEW |