| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 observe_invalid_accept: ["Object.observe accept must be an array of str
ings."], | 102 observe_invalid_accept: ["Object.observe accept must be an array of str
ings."], |
| 103 observe_type_non_string: ["Invalid changeRecord with non-string 'type' p
roperty"], | 103 observe_type_non_string: ["Invalid changeRecord with non-string 'type' p
roperty"], |
| 104 observe_perform_non_string: ["Invalid non-string changeType"], | 104 observe_perform_non_string: ["Invalid non-string changeType"], |
| 105 observe_perform_non_function: ["Cannot perform non-function"], | 105 observe_perform_non_function: ["Cannot perform non-function"], |
| 106 observe_notify_non_notifier: ["notify called on non-notifier object"], | 106 observe_notify_non_notifier: ["notify called on non-notifier object"], |
| 107 proto_poison_pill: ["Generic use of __proto__ accessor not allowed
"], | 107 proto_poison_pill: ["Generic use of __proto__ accessor not allowed
"], |
| 108 not_typed_array: ["this is not a typed array."], | 108 not_typed_array: ["this is not a typed array."], |
| 109 invalid_argument: ["invalid_argument"], | 109 invalid_argument: ["invalid_argument"], |
| 110 data_view_not_array_buffer: ["First argument to DataView constructor must b
e an ArrayBuffer"], | 110 data_view_not_array_buffer: ["First argument to DataView constructor must b
e an ArrayBuffer"], |
| 111 constructor_not_function: ["Constructor ", "%0", " requires 'new'"], | 111 constructor_not_function: ["Constructor ", "%0", " requires 'new'"], |
| 112 not_a_promise: ["%0", "is not a promise"], |
| 113 promise_cyclic: ["Chaining cycle detected for promise", "%0"], |
| 112 // RangeError | 114 // RangeError |
| 113 invalid_array_length: ["Invalid array length"], | 115 invalid_array_length: ["Invalid array length"], |
| 114 invalid_array_buffer_length: ["Invalid array buffer length"], | 116 invalid_array_buffer_length: ["Invalid array buffer length"], |
| 115 invalid_typed_array_offset: ["Start offset is too large:"], | 117 invalid_typed_array_offset: ["Start offset is too large:"], |
| 116 invalid_typed_array_length: ["Invalid typed array length"], | 118 invalid_typed_array_length: ["Invalid typed array length"], |
| 117 invalid_typed_array_alignment: ["%0", "of", "%1", "should be a multiple of", "
%3"], | 119 invalid_typed_array_alignment: ["%0", "of", "%1", "should be a multiple of", "
%3"], |
| 118 typed_array_set_source_too_large: | 120 typed_array_set_source_too_large: |
| 119 ["Source is too large"], | 121 ["Source is too large"], |
| 120 typed_array_set_negative_offset: | 122 typed_array_set_negative_offset: |
| 121 ["Start offset is negative"], | 123 ["Start offset is negative"], |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 var arg_num = 0; | 191 var arg_num = 0; |
| 190 for (var i = 0; i < format.length; i++) { | 192 for (var i = 0; i < format.length; i++) { |
| 191 var str = format[i]; | 193 var str = format[i]; |
| 192 if (str.length == 2 && %_StringCharCodeAt(str, 0) == 0x25) { | 194 if (str.length == 2 && %_StringCharCodeAt(str, 0) == 0x25) { |
| 193 // Two-char string starts with "%". | 195 // Two-char string starts with "%". |
| 194 var arg_num = (%_StringCharCodeAt(str, 1) - 0x30) >>> 0; | 196 var arg_num = (%_StringCharCodeAt(str, 1) - 0x30) >>> 0; |
| 195 if (arg_num < 4) { | 197 if (arg_num < 4) { |
| 196 // str is one of %0, %1, %2 or %3. | 198 // str is one of %0, %1, %2 or %3. |
| 197 try { | 199 try { |
| 198 str = NoSideEffectToString(args[arg_num]); | 200 str = NoSideEffectToString(args[arg_num]); |
| 201 if (str.length > 256) { |
| 202 str = %SubString(str, 0, 239) + "...<omitted>..." + |
| 203 %SubString(str, str.length - 2, str.length); |
| 204 } |
| 199 } catch (e) { | 205 } catch (e) { |
| 200 if (%IsJSModule(args[arg_num])) | 206 if (%IsJSModule(args[arg_num])) |
| 201 str = "module"; | 207 str = "module"; |
| 202 else if (IS_SPEC_OBJECT(args[arg_num])) | 208 else if (IS_SPEC_OBJECT(args[arg_num])) |
| 203 str = "object"; | 209 str = "object"; |
| 204 else | 210 else |
| 205 str = "#<error>"; | 211 str = "#<error>"; |
| 206 } | 212 } |
| 207 } | 213 } |
| 208 } | 214 } |
| (...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1347 %GetAndClearOverflowedStackTrace(this); | 1353 %GetAndClearOverflowedStackTrace(this); |
| 1348 }; | 1354 }; |
| 1349 | 1355 |
| 1350 %DefineOrRedefineAccessorProperty( | 1356 %DefineOrRedefineAccessorProperty( |
| 1351 boilerplate, 'stack', getter, setter, DONT_ENUM); | 1357 boilerplate, 'stack', getter, setter, DONT_ENUM); |
| 1352 | 1358 |
| 1353 return boilerplate; | 1359 return boilerplate; |
| 1354 } | 1360 } |
| 1355 | 1361 |
| 1356 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); | 1362 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); |
| OLD | NEW |