| 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 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 int lastColon = line.lastIndexOf(':', rightParenPos); | 148 int lastColon = line.lastIndexOf(':', rightParenPos); |
| 149 int nextToLastColon = line.lastIndexOf(':', lastColon-1); | 149 int nextToLastColon = line.lastIndexOf(':', lastColon-1); |
| 150 | 150 |
| 151 String lineNo; | 151 String lineNo; |
| 152 String columnNo; | 152 String columnNo; |
| 153 if (nextToLastColon != -1) { | 153 if (nextToLastColon != -1) { |
| 154 lineNo = line.substring(nextToLastColon+1, lastColon); | 154 lineNo = line.substring(nextToLastColon+1, lastColon); |
| 155 columnNo = line.substring(lastColon+1, rightParenPos); | 155 columnNo = line.substring(lastColon+1, rightParenPos); |
| 156 try { | 156 try { |
| 157 int.parse(lineNo); | 157 int.parse(lineNo); |
| 158 } on FormatException catch (e) { | 158 } on FormatException { |
| 159 lineNo = columnNo; | 159 lineNo = columnNo; |
| 160 columnNo = ''; | 160 columnNo = ''; |
| 161 nextToLastColon = lastColon; | 161 nextToLastColon = lastColon; |
| 162 } | 162 } |
| 163 } else { | 163 } else { |
| 164 lineNo = line.substring(lastColon+1, rightParenPos); | 164 lineNo = line.substring(lastColon+1, rightParenPos); |
| 165 columnNo = ''; | 165 columnNo = ''; |
| 166 nextToLastColon = lastColon; | 166 nextToLastColon = lastColon; |
| 167 } | 167 } |
| 168 | 168 |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 } | 330 } |
| 331 for (int index = text.length ; index < intendedLength ; index ++) { | 331 for (int index = text.length ; index < intendedLength ; index ++) { |
| 332 int dotsIndex = index % dotsLength; | 332 int dotsIndex = index % dotsLength; |
| 333 sb.write(dots.substring(dotsIndex, dotsIndex + 1)); | 333 sb.write(dots.substring(dotsIndex, dotsIndex + 1)); |
| 334 } | 334 } |
| 335 if (padLeft) { | 335 if (padLeft) { |
| 336 sb.write(text); | 336 sb.write(text); |
| 337 } | 337 } |
| 338 return sb.toString(); | 338 return sb.toString(); |
| 339 } | 339 } |
| OLD | NEW |