| 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 driver; | 5 library driver; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 import 'dart:math'; | 9 import 'dart:math'; |
| 10 | 10 |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 * exceptions and both report them to the client and send them to the given | 446 * exceptions and both report them to the client and send them to the given |
| 447 * instrumentation [service]. If a [print] function is provided, then also | 447 * instrumentation [service]. If a [print] function is provided, then also |
| 448 * capture any data printed by the callback and redirect it to the function. | 448 * capture any data printed by the callback and redirect it to the function. |
| 449 */ | 449 */ |
| 450 dynamic _captureExceptions(InstrumentationService service, dynamic callback(), | 450 dynamic _captureExceptions(InstrumentationService service, dynamic callback(), |
| 451 {void print(String line)}) { | 451 {void print(String line)}) { |
| 452 Function errorFunction = (Zone self, ZoneDelegate parent, Zone zone, | 452 Function errorFunction = (Zone self, ZoneDelegate parent, Zone zone, |
| 453 dynamic exception, StackTrace stackTrace) { | 453 dynamic exception, StackTrace stackTrace) { |
| 454 service.logPriorityException(exception, stackTrace); | 454 service.logPriorityException(exception, stackTrace); |
| 455 AnalysisServer analysisServer = socketServer.analysisServer; | 455 AnalysisServer analysisServer = socketServer.analysisServer; |
| 456 analysisServer.sendServerErrorNotification(exception, stackTrace); | 456 analysisServer.sendServerErrorNotification( |
| 457 'Captured exception', exception, stackTrace); |
| 457 throw exception; | 458 throw exception; |
| 458 }; | 459 }; |
| 459 Function printFunction = print == null | 460 Function printFunction = print == null |
| 460 ? null | 461 ? null |
| 461 : (Zone self, ZoneDelegate parent, Zone zone, String line) { | 462 : (Zone self, ZoneDelegate parent, Zone zone, String line) { |
| 462 // Note: we don't pass the line on to stdout, because that is reserv
ed | 463 // Note: we don't pass the line on to stdout, because that is reserv
ed |
| 463 // for communication to the client. | 464 // for communication to the client. |
| 464 print(line); | 465 print(line); |
| 465 }; | 466 }; |
| 466 ZoneSpecification zoneSpecification = new ZoneSpecification( | 467 ZoneSpecification zoneSpecification = new ZoneSpecification( |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 */ | 589 */ |
| 589 static void _rollLogFiles(String path, int numOld) { | 590 static void _rollLogFiles(String path, int numOld) { |
| 590 for (int i = numOld - 1; i >= 0; i--) { | 591 for (int i = numOld - 1; i >= 0; i--) { |
| 591 try { | 592 try { |
| 592 String oldPath = i == 0 ? path : '$path.$i'; | 593 String oldPath = i == 0 ? path : '$path.$i'; |
| 593 new File(oldPath).renameSync('$path.${i+1}'); | 594 new File(oldPath).renameSync('$path.${i+1}'); |
| 594 } catch (e) {} | 595 } catch (e) {} |
| 595 } | 596 } |
| 596 } | 597 } |
| 597 } | 598 } |
| OLD | NEW |