| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 'dart:convert'; | 6 import 'dart:convert'; |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 | 8 |
| 9 import 'package:async_helper/async_helper.dart'; | 9 import 'package:async_helper/async_helper.dart'; |
| 10 import 'package:compiler/compiler_new.dart'; | 10 import 'package:compiler/compiler_new.dart'; |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 ]; | 202 ]; |
| 203 | 203 |
| 204 class Test { | 204 class Test { |
| 205 final String code; | 205 final String code; |
| 206 final List<StackTraceLine> expectedLines; | 206 final List<StackTraceLine> expectedLines; |
| 207 final List<StackTraceLine> unexpectedLines; | 207 final List<StackTraceLine> unexpectedLines; |
| 208 | 208 |
| 209 Test(this.code, this.expectedLines, this.unexpectedLines); | 209 Test(this.code, this.expectedLines, this.unexpectedLines); |
| 210 } | 210 } |
| 211 | 211 |
| 212 const int _LF = 0x0A; | |
| 213 const int _CR = 0x0D; | |
| 214 const int _LBRACE = 0x7B; | |
| 215 | |
| 216 Test processTestCode(String code) { | 212 Test processTestCode(String code) { |
| 217 Map<int, StackTraceLine> stackTraceMap = <int, StackTraceLine>{}; | 213 Map<int, StackTraceLine> stackTraceMap = <int, StackTraceLine>{}; |
| 218 List<StackTraceLine> unexpectedLines = <StackTraceLine>[]; | 214 List<StackTraceLine> unexpectedLines = <StackTraceLine>[]; |
| 219 AnnotatedCode annotatedCode = new AnnotatedCode(code); | 215 AnnotatedCode annotatedCode = new AnnotatedCode.fromText(code); |
| 220 for (Annotation annotation in annotatedCode.annotations) { | 216 for (Annotation annotation in annotatedCode.annotations) { |
| 221 int colonIndex = annotation.text.indexOf(':'); | 217 int colonIndex = annotation.text.indexOf(':'); |
| 222 String indexText = annotation.text.substring(0, colonIndex); | 218 String indexText = annotation.text.substring(0, colonIndex); |
| 223 String methodName = annotation.text.substring(colonIndex + 1); | 219 String methodName = annotation.text.substring(colonIndex + 1); |
| 224 StackTraceLine stackTraceLine = new StackTraceLine( | 220 StackTraceLine stackTraceLine = new StackTraceLine( |
| 225 methodName, INPUT_FILE_NAME, annotation.lineNo, annotation.columnNo); | 221 methodName, INPUT_FILE_NAME, annotation.lineNo, annotation.columnNo); |
| 226 if (indexText == '') { | 222 if (indexText == '') { |
| 227 unexpectedLines.add(stackTraceLine); | 223 unexpectedLines.add(stackTraceLine); |
| 228 } else { | 224 } else { |
| 229 int stackTraceIndex = int.parse(indexText); | 225 int stackTraceIndex = int.parse(indexText); |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 const LineException( | 550 const LineException( |
| 555 '_awaitOnObject.<anonymous function>', 'async_patch.dart'), | 551 '_awaitOnObject.<anonymous function>', 'async_patch.dart'), |
| 556 const LineException('_RootZone.runUnary', 'zone.dart'), | 552 const LineException('_RootZone.runUnary', 'zone.dart'), |
| 557 const LineException('_FutureListener.handleValue', 'future_impl.dart'), | 553 const LineException('_FutureListener.handleValue', 'future_impl.dart'), |
| 558 const LineException( | 554 const LineException( |
| 559 '_Future._propagateToListeners.handleValueCallback', 'future_impl.dart'), | 555 '_Future._propagateToListeners.handleValueCallback', 'future_impl.dart'), |
| 560 const LineException('_Future._propagateToListeners', 'future_impl.dart'), | 556 const LineException('_Future._propagateToListeners', 'future_impl.dart'), |
| 561 const LineException( | 557 const LineException( |
| 562 '_Future._addListener.<anonymous function>', 'future_impl.dart'), | 558 '_Future._addListener.<anonymous function>', 'future_impl.dart'), |
| 563 ]; | 559 ]; |
| OLD | NEW |