| 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:uri'); | 5 #import('dart:uri'); |
| 6 | 6 |
| 7 #import("../../../lib/compiler/implementation/leg.dart"); | 7 #import("../../../lib/compiler/implementation/leg.dart"); |
| 8 #import('../../../lib/compiler/implementation/source_file.dart'); | 8 #import('../../../lib/compiler/implementation/source_file.dart'); |
| 9 #import("mock_compiler.dart"); | 9 #import("mock_compiler.dart"); |
| 10 #import('parser_helper.dart'); | 10 #import('parser_helper.dart'); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 @staticSend(0); | 66 @staticSend(0); |
| 67 NewSend o = new @NewSend(); | 67 NewSend o = new @NewSend(); |
| 68 @o.dynamicSend(0); | 68 @o.dynamicSend(0); |
| 69 var closureSend = (x) { print(x); }; | 69 var closureSend = (x) { print(x); }; |
| 70 @closureSend(0); | 70 @closureSend(0); |
| 71 } | 71 } |
| 72 void staticSend(x) { print(x); } | 72 void staticSend(x) { print(x); } |
| 73 class NewSend { void dynamicSend(x) { print(x); } } | 73 class NewSend { void dynamicSend(x) { print(x); } } |
| 74 '''; | 74 '''; |
| 75 | 75 |
| 76 String LOOP_TEST = ''' |
| 77 void main() { |
| 78 @for (int i = 0; i < 100; ++i) { print(test(13)); @} |
| 79 } |
| 80 int test(int x) { |
| 81 int result = 1; @while (result < x) { result <<= 1; @} return result; |
| 82 }'''; |
| 83 |
| 84 |
| 76 main() { | 85 main() { |
| 77 // These tests are fragile, since mappings for specific source locations | 86 // These tests are fragile, since mappings for specific source locations |
| 78 // could disappear due to various optimizations like code elimination, | 87 // could disappear due to various optimizations like code elimination, |
| 79 // function inlining, etc. If you broke the test, please try to rewrite it | 88 // function inlining, etc. If you broke the test, please try to rewrite it |
| 80 // so that the new code is not optimized, otherwise just remove the marker | 89 // so that the new code is not optimized, otherwise just remove the marker |
| 81 // from problematic location. | 90 // from problematic location. |
| 82 testSourceMapLocations(FUNCTIONS_TEST); | 91 testSourceMapLocations(FUNCTIONS_TEST); |
| 83 testSourceMapLocations(RETURN_TEST); | 92 testSourceMapLocations(RETURN_TEST); |
| 84 testSourceMapLocations(NOT_TEST); | 93 testSourceMapLocations(NOT_TEST); |
| 85 testSourceMapLocations(UNARY_TEST); | 94 testSourceMapLocations(UNARY_TEST); |
| 86 testSourceMapLocations(BINARY_TEST); | 95 testSourceMapLocations(BINARY_TEST); |
| 87 testSourceMapLocations(SEND_TEST); | 96 testSourceMapLocations(SEND_TEST); |
| 97 testSourceMapLocations(LOOP_TEST); |
| 88 } | 98 } |
| OLD | NEW |