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