| 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 analysis.server; | 5 library analysis.server; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:core' hide Resource; | 9 import 'dart:core' hide Resource; |
| 10 import 'dart:math' show max; | 10 import 'dart:math' show max; |
| (...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 if (exception != null) { | 860 if (exception != null) { |
| 861 exceptionString = exception.toString(); | 861 exceptionString = exception.toString(); |
| 862 } else { | 862 } else { |
| 863 exceptionString = 'null exception'; | 863 exceptionString = 'null exception'; |
| 864 } | 864 } |
| 865 // prepare stackTrace.toString() | 865 // prepare stackTrace.toString() |
| 866 String stackTraceString; | 866 String stackTraceString; |
| 867 if (stackTrace != null) { | 867 if (stackTrace != null) { |
| 868 stackTraceString = stackTrace.toString(); | 868 stackTraceString = stackTrace.toString(); |
| 869 } else { | 869 } else { |
| 870 stackTraceString = 'null stackTrace'; | 870 try { |
| 871 throw 'ignored'; |
| 872 } catch (ignored, stackTrace) { |
| 873 stackTraceString = stackTrace.toString(); |
| 874 } |
| 875 if (stackTraceString == null) { |
| 876 // This code should be unreachable. |
| 877 stackTraceString = 'null stackTrace'; |
| 878 } |
| 871 } | 879 } |
| 872 // send the notification | 880 // send the notification |
| 873 channel.sendNotification( | 881 channel.sendNotification( |
| 874 new ServerErrorParams(fatal, exceptionString, stackTraceString) | 882 new ServerErrorParams(fatal, exceptionString, stackTraceString) |
| 875 .toNotification()); | 883 .toNotification()); |
| 876 } | 884 } |
| 877 | 885 |
| 878 /** | 886 /** |
| 879 * Send status notification to the client. The `operation` is the operation | 887 * Send status notification to the client. The `operation` is the operation |
| 880 * being performed or `null` if analysis is complete. | 888 * being performed or `null` if analysis is complete. |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1565 /** | 1573 /** |
| 1566 * The [PerformanceTag] for time spent in server request handlers. | 1574 * The [PerformanceTag] for time spent in server request handlers. |
| 1567 */ | 1575 */ |
| 1568 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); | 1576 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); |
| 1569 | 1577 |
| 1570 /** | 1578 /** |
| 1571 * The [PerformanceTag] for time spent in split store microtasks. | 1579 * The [PerformanceTag] for time spent in split store microtasks. |
| 1572 */ | 1580 */ |
| 1573 static PerformanceTag splitStore = new PerformanceTag('splitStore'); | 1581 static PerformanceTag splitStore = new PerformanceTag('splitStore'); |
| 1574 } | 1582 } |
| OLD | NEW |