| 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/implementation/dart2jslib.dart"; | 8 import "package:compiler/implementation/dart2jslib.dart"; |
| 9 import 'package:compiler/implementation/source_file.dart'; | 9 import 'package:compiler/implementation/source_file.dart'; |
| 10 import "mock_compiler.dart"; | 10 import "mock_compiler.dart"; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 } | 38 } |
| 39 }); | 39 }); |
| 40 | 40 |
| 41 for (int i = 0; i < expectedLocations.length; ++i) { | 41 for (int i = 0; i < expectedLocations.length; ++i) { |
| 42 int expectedLocation = expectedLocations[i]; | 42 int expectedLocation = expectedLocations[i]; |
| 43 if (!locations.contains(expectedLocation)) { | 43 if (!locations.contains(expectedLocation)) { |
| 44 int originalLocation = expectedLocation + i; | 44 int originalLocation = expectedLocation + i; |
| 45 SourceFile sourceFileWithMarkers = | 45 SourceFile sourceFileWithMarkers = |
| 46 new StringSourceFile('<test script>', codeWithMarkers); | 46 new StringSourceFile('<test script>', codeWithMarkers); |
| 47 String message = sourceFileWithMarkers.getLocationMessage( | 47 String message = sourceFileWithMarkers.getLocationMessage( |
| 48 'Missing location', originalLocation, originalLocation + 1, true, | 48 'Missing location', originalLocation, originalLocation + 1); |
| 49 (s) => s); | |
| 50 Expect.fail(message); | 49 Expect.fail(message); |
| 51 } | 50 } |
| 52 } | 51 } |
| 53 })); | 52 })); |
| 54 } | 53 } |
| 55 | 54 |
| 56 String FUNCTIONS_TEST = ''' | 55 String FUNCTIONS_TEST = ''' |
| 57 @void main() { print(test(15)); @} | 56 @void main() { print(test(15)); @} |
| 58 // The 'if' has been added to avoid inlining of 'test'. | 57 // The 'if' has been added to avoid inlining of 'test'. |
| 59 @int test(int x) { if (x != null) return x; else return null; @}'''; | 58 @int test(int x) { if (x != null) return x; else return null; @}'''; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 testSourceMapLocations(FUNCTIONS_TEST); | 103 testSourceMapLocations(FUNCTIONS_TEST); |
| 105 testSourceMapLocations(RETURN_TEST); | 104 testSourceMapLocations(RETURN_TEST); |
| 106 testSourceMapLocations(NOT_TEST); | 105 testSourceMapLocations(NOT_TEST); |
| 107 testSourceMapLocations(UNARY_TEST); | 106 testSourceMapLocations(UNARY_TEST); |
| 108 testSourceMapLocations(BINARY_TEST); | 107 testSourceMapLocations(BINARY_TEST); |
| 109 testSourceMapLocations(SEND_TEST); | 108 testSourceMapLocations(SEND_TEST); |
| 110 testSourceMapLocations(SEND_SET_TEST); | 109 testSourceMapLocations(SEND_SET_TEST); |
| 111 testSourceMapLocations(LOOP_TEST); | 110 testSourceMapLocations(LOOP_TEST); |
| 112 testSourceMapLocations(INTERCEPTOR_TEST); | 111 testSourceMapLocations(INTERCEPTOR_TEST); |
| 113 } | 112 } |
| OLD | NEW |