Chromium Code Reviews| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 82 class A { int x; foo() { @x = 3; } }'''; | 82 class A { int x; foo() { @x = 3; } }'''; |
| 83 | 83 |
| 84 String LOOP_TEST = ''' | 84 String LOOP_TEST = ''' |
| 85 void main() { | 85 void main() { |
| 86 @for (int i = 0; i < 100; ++i) { print(test(13)); @} | 86 @for (int i = 0; i < 100; ++i) { print(test(13)); @} |
| 87 } | 87 } |
| 88 int test(int x) { | 88 int test(int x) { |
| 89 int result = 1; @while (result < x) { result <<= 1; @} return result; | 89 int result = 1; @while (result < x) { result <<= 1; @} return result; |
| 90 }'''; | 90 }'''; |
| 91 | 91 |
| 92 String INTERCEPTOR_TEST = '''void main() { var l = []; @l.add(0); print(l); }''' ; | |
|
ahe
2012/09/24 12:56:21
Long line.
podivilov1
2012/09/24 15:04:49
Done.
| |
| 92 | 93 |
| 93 main() { | 94 main() { |
| 94 // These tests are fragile, since mappings for specific source locations | 95 // These tests are fragile, since mappings for specific source locations |
| 95 // could disappear due to various optimizations like code elimination, | 96 // could disappear due to various optimizations like code elimination, |
| 96 // function inlining, etc. If you broke the test, please try to rewrite it | 97 // function inlining, etc. If you broke the test, please try to rewrite it |
| 97 // so that the new code is not optimized, otherwise just remove the marker | 98 // so that the new code is not optimized, otherwise just remove the marker |
| 98 // from problematic location. | 99 // from problematic location. |
| 99 testSourceMapLocations(FUNCTIONS_TEST); | 100 testSourceMapLocations(FUNCTIONS_TEST); |
| 100 testSourceMapLocations(RETURN_TEST); | 101 testSourceMapLocations(RETURN_TEST); |
| 101 testSourceMapLocations(NOT_TEST); | 102 testSourceMapLocations(NOT_TEST); |
| 102 testSourceMapLocations(UNARY_TEST); | 103 testSourceMapLocations(UNARY_TEST); |
| 103 testSourceMapLocations(BINARY_TEST); | 104 testSourceMapLocations(BINARY_TEST); |
| 104 testSourceMapLocations(SEND_TEST); | 105 testSourceMapLocations(SEND_TEST); |
| 105 testSourceMapLocations(SEND_SET_TEST); | 106 testSourceMapLocations(SEND_SET_TEST); |
| 106 testSourceMapLocations(LOOP_TEST); | 107 testSourceMapLocations(LOOP_TEST); |
| 108 testSourceMapLocations(INTERCEPTOR_TEST); | |
| 107 } | 109 } |
| OLD | NEW |