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

Side by Side Diff: pkg/compiler/lib/src/helpers/trace.dart

Issue 1160313006: Revert "Refactoring resolution of local access and unqualified access of statics" (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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
OLDNEW
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 part of dart2js.helpers; 5 part of dart2js.helpers;
6 6
7 /// Function signature for [trace]. 7 /// Function signature for [trace].
8 typedef void Trace(String message, 8 typedef void Trace(String message,
9 {bool condition(String stackTrace), 9 {bool condition(String stackTrace),
10 int limit, 10 int limit,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 stackTrace = '$s'; 46 stackTrace = '$s';
47 } 47 }
48 if (condition != null) { 48 if (condition != null) {
49 if (!condition(stackTrace)) return; 49 if (!condition(stackTrace)) return;
50 } 50 }
51 print('$message\n$stackTrace'); 51 print('$message\n$stackTrace');
52 if (throwOnPrint) throw message; 52 if (throwOnPrint) throw message;
53 } 53 }
54 } 54 }
55 55
56 /// Creates a function to use as an `condition` argument in [trace] that filters
57 /// stack traces that contains any of the [exceptions].
58 traceExceptions(List<String> exceptions) {
59 return (String stackTrace) => !exceptions.any(stackTrace.contains);
60 }
61
62 /// Function signature of [traceAndReport]. 56 /// Function signature of [traceAndReport].
63 typedef void TraceAndReport(Compiler compiler, Spannable node, String message, 57 typedef void TraceAndReport(Compiler compiler, Spannable node, String message,
64 {bool condition(String stackTrace), int limit, 58 {bool condition(String stackTrace), int limit,
65 bool throwOnPrint}); 59 bool throwOnPrint});
66 60
67 /// Calls [reportHere] and [trace] with the same message. 61 /// Calls [reportHere] and [trace] with the same message.
68 TraceAndReport get traceAndReport { 62 TraceAndReport get traceAndReport {
69 enableDebugMode(); 63 enableDebugMode();
70 return _traceAndReport; 64 return _traceAndReport;
71 } 65 }
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 } 324 }
331 for (int index = text.length ; index < intendedLength ; index ++) { 325 for (int index = text.length ; index < intendedLength ; index ++) {
332 int dotsIndex = index % dotsLength; 326 int dotsIndex = index % dotsLength;
333 sb.write(dots.substring(dotsIndex, dotsIndex + 1)); 327 sb.write(dots.substring(dotsIndex, dotsIndex + 1));
334 } 328 }
335 if (padLeft) { 329 if (padLeft) {
336 sb.write(text); 330 sb.write(text);
337 } 331 }
338 return sb.toString(); 332 return sb.toString();
339 } 333 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/enqueue.dart ('k') | pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698