| 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 for debugging helpers. The unittest analyze_unused_test checks that | 5 /// Library for debugging helpers. The unittest analyze_unused_test checks that |
| 6 /// the helper are not used in production code. | 6 /// the helper are not used in production code. |
| 7 | 7 |
| 8 library dart2js.helpers; | 8 library dart2js.helpers; |
| 9 | 9 |
| 10 import '../common.dart'; | 10 import '../common.dart'; |
| 11 import '../diagnostics/invariant.dart' show DEBUG_MODE; | 11 import '../diagnostics/invariant.dart' show DEBUG_MODE; |
| 12 import '../util/util.dart'; | 12 import '../util/util.dart'; |
| 13 | |
| 14 import 'trace.dart'; | 13 import 'trace.dart'; |
| 15 | 14 |
| 16 export 'debug_collection.dart'; | 15 export 'debug_collection.dart'; |
| 17 export 'trace.dart'; | |
| 18 export 'expensive_map.dart'; | 16 export 'expensive_map.dart'; |
| 19 export 'expensive_set.dart'; | 17 export 'expensive_set.dart'; |
| 20 export 'stats.dart'; | 18 export 'stats.dart'; |
| 19 export 'trace.dart'; |
| 21 export 'track_map.dart'; | 20 export 'track_map.dart'; |
| 22 | 21 |
| 23 /// Global flag to enable [debugPrint]. This should always be `true` by default | 22 /// Global flag to enable [debugPrint]. This should always be `true` by default |
| 24 /// and be set to `false` as a means to temporarily turn off all debugging | 23 /// and be set to `false` as a means to temporarily turn off all debugging |
| 25 /// printouts. | 24 /// printouts. |
| 26 const bool DEBUG_PRINT_ENABLED = true; | 25 const bool DEBUG_PRINT_ENABLED = true; |
| 27 | 26 |
| 28 /// Enables debug mode. | 27 /// Enables debug mode. |
| 29 /// | 28 /// |
| 30 /// Sets the [DEBUG_MODE] to `true`. | 29 /// Sets the [DEBUG_MODE] to `true`. |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 if (printTrace) { | 134 if (printTrace) { |
| 136 trace(msg); | 135 trace(msg); |
| 137 } else { | 136 } else { |
| 138 debugPrint(msg); | 137 debugPrint(msg); |
| 139 } | 138 } |
| 140 } | 139 } |
| 141 return true; | 140 return true; |
| 142 } | 141 } |
| 143 return false; | 142 return false; |
| 144 } | 143 } |
| OLD | NEW |