| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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:async'; | 5 import 'dart:async'; |
| 6 import 'package:expect/expect.dart'; | 6 import 'package:expect/expect.dart'; |
| 7 import 'package:async_helper/async_helper.dart'; | 7 import 'package:async_helper/async_helper.dart'; |
| 8 import 'package:compiler/src/io/code_output.dart'; | 8 import 'package:compiler/src/io/code_output.dart'; |
| 9 import 'package:compiler/src/io/source_file.dart'; | 9 import 'package:compiler/src/io/source_file.dart'; |
| 10 import 'package:compiler/src/io/source_information.dart'; | 10 import 'package:compiler/src/io/source_information.dart'; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 })); | 61 })); |
| 62 } | 62 } |
| 63 | 63 |
| 64 String FUNCTIONS_TEST = ''' | 64 String FUNCTIONS_TEST = ''' |
| 65 @void main() { print(test(15)); @} | 65 @void main() { print(test(15)); @} |
| 66 // The 'if' has been added to avoid inlining of 'test'. | 66 // The 'if' has been added to avoid inlining of 'test'. |
| 67 @int test(int x) { if (x != null) return x; else return null; @}'''; | 67 @int test(int x) { if (x != null) return x; else return null; @}'''; |
| 68 | 68 |
| 69 String RETURN_TEST = 'void main() { print(((x) { @return x; })(0)); }'; | 69 String RETURN_TEST = 'void main() { print(((x) { @return x; })(0)); }'; |
| 70 | 70 |
| 71 String NOT_TEST = 'void main() { ((x) { if (@!x) print(x); })(false); }'; | 71 String NOT_TEST = 'void main() { ((x) { if (@!x) print(x); })(1==2); }'; |
| 72 | 72 |
| 73 String UNARY_TEST = 'void main() { ((x, y) { print(@-x + @~y); })(1,2); }'; | 73 String UNARY_TEST = 'void main() { ((x, y) { print(@-x + @~y); })(1,2); }'; |
| 74 | 74 |
| 75 String BINARY_TEST = 'void main() { ((x, y) { if (x @!= y) print(x @* y); })(1,2
); }'; | 75 String BINARY_TEST = 'void main() { ((x, y) { if (x @!= y) print(x @* y); })(1,2
); }'; |
| 76 | 76 |
| 77 String SEND_TEST = ''' | 77 String SEND_TEST = ''' |
| 78 void main() { | 78 void main() { |
| 79 @staticSend(0); | 79 @staticSend(0); |
| 80 NewSend o = @new NewSend(); | 80 NewSend o = @new NewSend(); |
| 81 @o.dynamicSend(0); | 81 @o.dynamicSend(0); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 112 testSourceMapLocations(FUNCTIONS_TEST); | 112 testSourceMapLocations(FUNCTIONS_TEST); |
| 113 testSourceMapLocations(RETURN_TEST); | 113 testSourceMapLocations(RETURN_TEST); |
| 114 testSourceMapLocations(NOT_TEST); | 114 testSourceMapLocations(NOT_TEST); |
| 115 testSourceMapLocations(UNARY_TEST); | 115 testSourceMapLocations(UNARY_TEST); |
| 116 testSourceMapLocations(BINARY_TEST); | 116 testSourceMapLocations(BINARY_TEST); |
| 117 testSourceMapLocations(SEND_TEST); | 117 testSourceMapLocations(SEND_TEST); |
| 118 testSourceMapLocations(SEND_SET_TEST); | 118 testSourceMapLocations(SEND_SET_TEST); |
| 119 testSourceMapLocations(LOOP_TEST); | 119 testSourceMapLocations(LOOP_TEST); |
| 120 testSourceMapLocations(INTERCEPTOR_TEST); | 120 testSourceMapLocations(INTERCEPTOR_TEST); |
| 121 } | 121 } |
| OLD | NEW |