| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 var arg_num = 0; | 189 var arg_num = 0; |
| 190 for (var i = 0; i < format.length; i++) { | 190 for (var i = 0; i < format.length; i++) { |
| 191 var str = format[i]; | 191 var str = format[i]; |
| 192 if (str.length == 2 && %_StringCharCodeAt(str, 0) == 0x25) { | 192 if (str.length == 2 && %_StringCharCodeAt(str, 0) == 0x25) { |
| 193 // Two-char string starts with "%". | 193 // Two-char string starts with "%". |
| 194 var arg_num = (%_StringCharCodeAt(str, 1) - 0x30) >>> 0; | 194 var arg_num = (%_StringCharCodeAt(str, 1) - 0x30) >>> 0; |
| 195 if (arg_num < 4) { | 195 if (arg_num < 4) { |
| 196 // str is one of %0, %1, %2 or %3. | 196 // str is one of %0, %1, %2 or %3. |
| 197 try { | 197 try { |
| 198 str = NoSideEffectToString(args[arg_num]); | 198 str = NoSideEffectToString(args[arg_num]); |
| 199 if (str.length > 256) { |
| 200 str = %SubString(str, 0, 239) + "...<omitted>..." + |
| 201 %SubString(str, str.length - 2, str.length); |
| 202 } |
| 199 } catch (e) { | 203 } catch (e) { |
| 200 if (%IsJSModule(args[arg_num])) | 204 if (%IsJSModule(args[arg_num])) |
| 201 str = "module"; | 205 str = "module"; |
| 202 else if (IS_SPEC_OBJECT(args[arg_num])) | 206 else if (IS_SPEC_OBJECT(args[arg_num])) |
| 203 str = "object"; | 207 str = "object"; |
| 204 else | 208 else |
| 205 str = "#<error>"; | 209 str = "#<error>"; |
| 206 } | 210 } |
| 207 } | 211 } |
| 208 } | 212 } |
| (...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1347 %GetAndClearOverflowedStackTrace(this); | 1351 %GetAndClearOverflowedStackTrace(this); |
| 1348 }; | 1352 }; |
| 1349 | 1353 |
| 1350 %DefineOrRedefineAccessorProperty( | 1354 %DefineOrRedefineAccessorProperty( |
| 1351 boilerplate, 'stack', getter, setter, DONT_ENUM); | 1355 boilerplate, 'stack', getter, setter, DONT_ENUM); |
| 1352 | 1356 |
| 1353 return boilerplate; | 1357 return boilerplate; |
| 1354 } | 1358 } |
| 1355 | 1359 |
| 1356 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); | 1360 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); |
| OLD | NEW |