OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2167 maxdigits = 3; | 2167 maxdigits = 3; |
2168 } | 2168 } |
2169 var result = ''; | 2169 var result = ''; |
2170 for (var num = 0; num < lines.length; num++) { | 2170 for (var num = 0; num < lines.length; num++) { |
2171 // Check if there's an extra newline at the end. | 2171 // Check if there's an extra newline at the end. |
2172 if (num == (lines.length - 1) && lines[num].length == 0) { | 2172 if (num == (lines.length - 1) && lines[num].length == 0) { |
2173 break; | 2173 break; |
2174 } | 2174 } |
2175 | 2175 |
2176 var current_line = from_line + num; | 2176 var current_line = from_line + num; |
2177 spacer = maxdigits - (1 + Math.floor(log10(current_line))); | 2177 var spacer = maxdigits - (1 + Math.floor(log10(current_line))); |
2178 if (current_line == Debug.State.currentSourceLine + 1) { | 2178 if (current_line == Debug.State.currentSourceLine + 1) { |
2179 for (var i = 0; i < maxdigits; i++) { | 2179 for (var i = 0; i < maxdigits; i++) { |
2180 result += '>'; | 2180 result += '>'; |
2181 } | 2181 } |
2182 result += ' '; | 2182 result += ' '; |
2183 } else { | 2183 } else { |
2184 for (var i = 0; i < spacer; i++) { | 2184 for (var i = 0; i < spacer; i++) { |
2185 result += ' '; | 2185 result += ' '; |
2186 } | 2186 } |
2187 result += current_line + ': '; | 2187 result += current_line + ': '; |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2804 json += NumberToJSON_(elem); | 2804 json += NumberToJSON_(elem); |
2805 } else if (typeof(elem) === 'string') { | 2805 } else if (typeof(elem) === 'string') { |
2806 json += StringToJSON_(elem); | 2806 json += StringToJSON_(elem); |
2807 } else { | 2807 } else { |
2808 json += elem; | 2808 json += elem; |
2809 } | 2809 } |
2810 } | 2810 } |
2811 json += ']'; | 2811 json += ']'; |
2812 return json; | 2812 return json; |
2813 } | 2813 } |
OLD | NEW |