Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: pkg/analyzer/lib/src/dart/analysis/driver.dart

Issue 2666003002: Actually limit number of stored exception contexts. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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:collection'; 6 import 'dart:collection';
7 import 'dart:typed_data'; 7 import 'dart:typed_data';
8 8
9 import 'package:analyzer/context/declared_variables.dart'; 9 import 'package:analyzer/context/declared_variables.dart';
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 exception = state.exception; 1157 exception = state.exception;
1158 stackTrace = state.stackTrace; 1158 stackTrace = state.stackTrace;
1159 contextKey = state.contextKey; 1159 contextKey = state.contextKey;
1160 } 1160 }
1161 CaughtException caught = new CaughtException(exception, stackTrace); 1161 CaughtException caught = new CaughtException(exception, stackTrace);
1162 _exceptionController.add(new ExceptionResult(path, caught, contextKey)); 1162 _exceptionController.add(new ExceptionResult(path, caught, contextKey));
1163 } 1163 }
1164 1164
1165 String _storeExceptionContext( 1165 String _storeExceptionContext(
1166 String path, FileState libraryFile, exception, StackTrace stackTrace) { 1166 String path, FileState libraryFile, exception, StackTrace stackTrace) {
1167 if (allowedNumberOfContextsToWrite > 0) { 1167 if (allowedNumberOfContextsToWrite <= 0) {
1168 return null;
1169 } else {
1168 allowedNumberOfContextsToWrite--; 1170 allowedNumberOfContextsToWrite--;
1169 } 1171 }
1170 try { 1172 try {
1171 List<AnalysisDriverExceptionFileBuilder> contextFiles = libraryFile 1173 List<AnalysisDriverExceptionFileBuilder> contextFiles = libraryFile
1172 .transitiveFiles 1174 .transitiveFiles
1173 .map((file) => new AnalysisDriverExceptionFileBuilder( 1175 .map((file) => new AnalysisDriverExceptionFileBuilder(
1174 path: file.path, content: file.content)) 1176 path: file.path, content: file.content))
1175 .toList(); 1177 .toList();
1176 contextFiles.sort((a, b) => a.path.compareTo(b.path)); 1178 contextFiles.sort((a, b) => a.path.compareTo(b.path));
1177 AnalysisDriverExceptionContextBuilder contextBuilder = 1179 AnalysisDriverExceptionContextBuilder contextBuilder =
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
1869 libraryDeclarations.add(new TopLevelDeclarationInSource( 1871 libraryDeclarations.add(new TopLevelDeclarationInSource(
1870 file.source, declaration, isExported)); 1872 file.source, declaration, isExported));
1871 } 1873 }
1872 } 1874 }
1873 } 1875 }
1874 1876
1875 // We're not done yet. 1877 // We're not done yet.
1876 return false; 1878 return false;
1877 } 1879 }
1878 } 1880 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698