OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library fletchc.test.feature_test; | 5 library fletchc.test.feature_test; |
6 | 6 |
7 import 'dart:io' hide | 7 import 'dart:io' hide |
8 exitCode, | 8 exitCode, |
9 stderr, | 9 stderr, |
10 stdin, | 10 stdin, |
(...skipping 22 matching lines...) Expand all Loading... |
33 import 'compiler_test_case.dart' show | 33 import 'compiler_test_case.dart' show |
34 CompilerTestCase; | 34 CompilerTestCase; |
35 | 35 |
36 import 'package:compiler/src/elements/elements.dart' show | 36 import 'package:compiler/src/elements/elements.dart' show |
37 AbstractFieldElement, | 37 AbstractFieldElement, |
38 Element, | 38 Element, |
39 FieldElement, | 39 FieldElement, |
40 FunctionElement, | 40 FunctionElement, |
41 LibraryElement; | 41 LibraryElement; |
42 | 42 |
43 import 'package:compiler/src/dart2jslib.dart' show | 43 import 'package:compiler/src/compiler.dart' show |
44 Compiler; | 44 Compiler; |
45 | 45 |
46 import 'package:compiler/src/source_file_provider.dart' show | 46 import 'package:compiler/src/source_file_provider.dart' show |
47 FormattingDiagnosticHandler, | 47 FormattingDiagnosticHandler, |
48 SourceFileProvider; | 48 SourceFileProvider; |
49 | 49 |
50 import 'package:compiler/src/io/source_file.dart' show | 50 import 'package:compiler/src/io/source_file.dart' show |
51 StringSourceFile; | 51 StringSourceFile; |
52 | 52 |
53 import 'package:fletchc/incremental/fletchc_incremental.dart' show | 53 import 'package:fletchc/incremental/fletchc_incremental.dart' show |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 await session.toggleInternal(); | 253 await session.toggleInternal(); |
254 } | 254 } |
255 | 255 |
256 if (result.successful) { | 256 if (result.successful) { |
257 // Set breakpoint in main in case main was replaced. | 257 // Set breakpoint in main in case main was replaced. |
258 var breakpoints = | 258 var breakpoints = |
259 await session.setBreakpoint(methodName: "main", bytecodeIndex: 0); | 259 await session.setBreakpoint(methodName: "main", bytecodeIndex: 0); |
260 for (var breakpoint in breakpoints) { | 260 for (var breakpoint in breakpoints) { |
261 print("Added breakpoint: $breakpoint"); | 261 print("Added breakpoint: $breakpoint"); |
262 } | 262 } |
263 if (!helper.compiler.compiler.mainFunction.isErroneous) { | 263 if (!helper.compiler.compiler.mainFunction.isMalformed) { |
264 // If there's a syntax error in main, we cannot find it to set a | 264 // If there's a syntax error in main, we cannot find it to set a |
265 // breakpoint. | 265 // breakpoint. |
266 // TODO(ahe): Consider if this is a problem? | 266 // TODO(ahe): Consider if this is a problem? |
267 Expect.equals(1, breakpoints.length); | 267 Expect.equals(1, breakpoints.length); |
268 } | 268 } |
269 if (isFirstProgram) { | 269 if (isFirstProgram) { |
270 // Run the program to hit the breakpoint in main. | 270 // Run the program to hit the breakpoint in main. |
271 await session.debugRun(); | 271 await session.debugRun(); |
272 } else { | 272 } else { |
273 // Restart the current frame to rerun main. | 273 // Restart the current frame to rerun main. |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 | 755 |
756 Future<List<int>> readUtf8BytesFromUri(Uri uri) { | 756 Future<List<int>> readUtf8BytesFromUri(Uri uri) { |
757 throw "not supported"; | 757 throw "not supported"; |
758 } | 758 } |
759 | 759 |
760 static String readCachedFile(Uri uri) { | 760 static String readCachedFile(Uri uri) { |
761 return cachedFiles.putIfAbsent( | 761 return cachedFiles.putIfAbsent( |
762 uri, () => new File.fromUri(uri).readAsStringSync()); | 762 uri, () => new File.fromUri(uri).readAsStringSync()); |
763 } | 763 } |
764 } | 764 } |
OLD | NEW |