| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 invalid_json: ["String '", "%0", "' is not valid JSON"], | 148 invalid_json: ["String '", "%0", "' is not valid JSON"], |
| 149 circular_structure: ["Converting circular structure to JSON"], | 149 circular_structure: ["Converting circular structure to JSON"], |
| 150 called_on_non_object: ["%0", " called on non-object"], | 150 called_on_non_object: ["%0", " called on non-object"], |
| 151 called_on_null_or_undefined: ["%0", " called on null or undefined"], | 151 called_on_null_or_undefined: ["%0", " called on null or undefined"], |
| 152 array_indexof_not_defined: ["Array.getIndexOf: Argument undefined"], | 152 array_indexof_not_defined: ["Array.getIndexOf: Argument undefined"], |
| 153 object_not_extensible: ["Can't add property ", "%0", ", object is not
extensible"], | 153 object_not_extensible: ["Can't add property ", "%0", ", object is not
extensible"], |
| 154 illegal_access: ["Illegal access"], | 154 illegal_access: ["Illegal access"], |
| 155 invalid_preparser_data: ["Invalid preparser data for function ", "%0"], | 155 invalid_preparser_data: ["Invalid preparser data for function ", "%0"], |
| 156 strict_mode_with: ["Strict mode code may not include a with state
ment"], | 156 strict_mode_with: ["Strict mode code may not include a with state
ment"], |
| 157 strict_eval_arguments: ["Unexpected eval or arguments in strict mode"]
, | 157 strict_eval_arguments: ["Unexpected eval or arguments in strict mode"]
, |
| 158 too_many_arguments: ["Too many arguments in function call (only 327
66 allowed)"], | 158 too_many_arguments: ["Too many arguments in function call (only 655
35 allowed)"], |
| 159 too_many_parameters: ["Too many parameters in function definition (o
nly 32766 allowed)"], | 159 too_many_parameters: ["Too many parameters in function definition (o
nly 65535 allowed)"], |
| 160 too_many_variables: ["Too many variables declared (only 131071 allo
wed)"], | 160 too_many_variables: ["Too many variables declared (only 131071 allo
wed)"], |
| 161 strict_param_dupe: ["Strict mode function may not have duplicate p
arameter names"], | 161 strict_param_dupe: ["Strict mode function may not have duplicate p
arameter names"], |
| 162 strict_octal_literal: ["Octal literals are not allowed in strict mode
."], | 162 strict_octal_literal: ["Octal literals are not allowed in strict mode
."], |
| 163 strict_duplicate_property: ["Duplicate data property in object literal not
allowed in strict mode"], | 163 strict_duplicate_property: ["Duplicate data property in object literal not
allowed in strict mode"], |
| 164 accessor_data_property: ["Object literal may not have data and accessor
property with the same name"], | 164 accessor_data_property: ["Object literal may not have data and accessor
property with the same name"], |
| 165 accessor_get_set: ["Object literal may not have multiple get/set
accessors with the same name"], | 165 accessor_get_set: ["Object literal may not have multiple get/set
accessors with the same name"], |
| 166 strict_delete: ["Delete of an unqualified identifier in strict
mode."], | 166 strict_delete: ["Delete of an unqualified identifier in strict
mode."], |
| 167 strict_delete_property: ["Cannot delete property '", "%0", "' of ", "%1
"], | 167 strict_delete_property: ["Cannot delete property '", "%0", "' of ", "%1
"], |
| 168 strict_const: ["Use of const in strict mode."], | 168 strict_const: ["Use of const in strict mode."], |
| 169 strict_function: ["In strict mode code, functions can only be de
clared at top level or immediately within another function." ], | 169 strict_function: ["In strict mode code, functions can only be de
clared at top level or immediately within another function." ], |
| (...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1067 return "<error: " + e + ">"; | 1067 return "<error: " + e + ">"; |
| 1068 } catch (ee) { | 1068 } catch (ee) { |
| 1069 return "<error>"; | 1069 return "<error>"; |
| 1070 } | 1070 } |
| 1071 } | 1071 } |
| 1072 } | 1072 } |
| 1073 | 1073 |
| 1074 | 1074 |
| 1075 function GetStackFrames(raw_stack) { | 1075 function GetStackFrames(raw_stack) { |
| 1076 var frames = new InternalArray(); | 1076 var frames = new InternalArray(); |
| 1077 var non_strict_frames = raw_stack[0]; | 1077 var sloppy_frames = raw_stack[0]; |
| 1078 for (var i = 1; i < raw_stack.length; i += 4) { | 1078 for (var i = 1; i < raw_stack.length; i += 4) { |
| 1079 var recv = raw_stack[i]; | 1079 var recv = raw_stack[i]; |
| 1080 var fun = raw_stack[i + 1]; | 1080 var fun = raw_stack[i + 1]; |
| 1081 var code = raw_stack[i + 2]; | 1081 var code = raw_stack[i + 2]; |
| 1082 var pc = raw_stack[i + 3]; | 1082 var pc = raw_stack[i + 3]; |
| 1083 var pos = %FunctionGetPositionForOffset(code, pc); | 1083 var pos = %FunctionGetPositionForOffset(code, pc); |
| 1084 non_strict_frames--; | 1084 sloppy_frames--; |
| 1085 frames.push(new CallSite(recv, fun, pos, (non_strict_frames < 0))); | 1085 frames.push(new CallSite(recv, fun, pos, (sloppy_frames < 0))); |
| 1086 } | 1086 } |
| 1087 return frames; | 1087 return frames; |
| 1088 } | 1088 } |
| 1089 | 1089 |
| 1090 | 1090 |
| 1091 // Flag to prevent recursive call of Error.prepareStackTrace. | 1091 // Flag to prevent recursive call of Error.prepareStackTrace. |
| 1092 var formatting_custom_stack_trace = false; | 1092 var formatting_custom_stack_trace = false; |
| 1093 | 1093 |
| 1094 | 1094 |
| 1095 function FormatStackTrace(obj, error_string, frames) { | 1095 function FormatStackTrace(obj, error_string, frames) { |
| (...skipping 251 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 |