| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 strict_var_name: ["Variable name may not be eval or arguments
in strict mode"], | 217 strict_var_name: ["Variable name may not be eval or arguments
in strict mode"], |
| 218 strict_function_name: ["Function name may not be eval or arguments
in strict mode"], | 218 strict_function_name: ["Function name may not be eval or arguments
in strict mode"], |
| 219 strict_octal_literal: ["Octal literals are not allowed in strict m
ode."], | 219 strict_octal_literal: ["Octal literals are not allowed in strict m
ode."], |
| 220 strict_duplicate_property: ["Duplicate data property in object literal
not allowed in strict mode"], | 220 strict_duplicate_property: ["Duplicate data property in object literal
not allowed in strict mode"], |
| 221 accessor_data_property: ["Object literal may not have data and acces
sor property with the same name"], | 221 accessor_data_property: ["Object literal may not have data and acces
sor property with the same name"], |
| 222 accessor_get_set: ["Object literal may not have multiple get/s
et accessors with the same name"], | 222 accessor_get_set: ["Object literal may not have multiple get/s
et accessors with the same name"], |
| 223 strict_lhs_assignment: ["Assignment to eval or arguments is not all
owed in strict mode"], | 223 strict_lhs_assignment: ["Assignment to eval or arguments is not all
owed in strict mode"], |
| 224 strict_lhs_postfix: ["Postfix increment/decrement may not have e
val or arguments operand in strict mode"], | 224 strict_lhs_postfix: ["Postfix increment/decrement may not have e
val or arguments operand in strict mode"], |
| 225 strict_lhs_prefix: ["Prefix increment/decrement may not have ev
al or arguments operand in strict mode"], | 225 strict_lhs_prefix: ["Prefix increment/decrement may not have ev
al or arguments operand in strict mode"], |
| 226 strict_reserved_word: ["Use of future reserved word in strict mode
"], | 226 strict_reserved_word: ["Use of future reserved word in strict mode
"], |
| 227 strict_delete: ["Delete of an unqualified identifier in str
ict mode."], |
| 228 strict_delete_property: ["Cannot delete property '", "%0", "' of ",
"%1"], |
| 229 strict_const: ["Use of const in strict mode."], |
| 230 strict_function: ["In strict mode code, functions can only be
declared at top level or immediately within another function." ], |
| 231 strict_read_only_property: ["Cannot assign to read only property '", "%
0", "' of ", "%1"], |
| 232 strict_cannot_assign: ["Cannot assign to read only '", "%0", "' in
strict mode"], |
| 227 }; | 233 }; |
| 228 } | 234 } |
| 229 var message_type = %MessageGetType(message); | 235 var message_type = %MessageGetType(message); |
| 230 var format = kMessages[message_type]; | 236 var format = kMessages[message_type]; |
| 231 if (!format) return "<unknown message " + message_type + ">"; | 237 if (!format) return "<unknown message " + message_type + ">"; |
| 232 return FormatString(format, message); | 238 return FormatString(format, message); |
| 233 } | 239 } |
| 234 | 240 |
| 235 | 241 |
| 236 function GetLineNumber(message) { | 242 function GetLineNumber(message) { |
| (...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1050 try { | 1056 try { |
| 1051 return %_CallFunction(this, errorToStringDetectCycle); | 1057 return %_CallFunction(this, errorToStringDetectCycle); |
| 1052 } catch(e) { | 1058 } catch(e) { |
| 1053 // If this error message was encountered already return the empty | 1059 // If this error message was encountered already return the empty |
| 1054 // string for it instead of recursively formatting it. | 1060 // string for it instead of recursively formatting it. |
| 1055 if (isCyclicErrorMarker(e)) return ''; | 1061 if (isCyclicErrorMarker(e)) return ''; |
| 1056 else throw e; | 1062 else throw e; |
| 1057 } | 1063 } |
| 1058 } | 1064 } |
| 1059 | 1065 |
| 1060 %FunctionSetName(errorToString, 'toString'); | 1066 |
| 1061 %SetProperty($Error.prototype, 'toString', errorToString, DONT_ENUM); | 1067 InstallFunctions($Error.prototype, DONT_ENUM, ['toString', errorToString]); |
| 1062 | 1068 |
| 1063 // Boilerplate for exceptions for stack overflows. Used from | 1069 // Boilerplate for exceptions for stack overflows. Used from |
| 1064 // Isolate::StackOverflow(). | 1070 // Isolate::StackOverflow(). |
| 1065 const kStackOverflowBoilerplate = MakeRangeError('stack_overflow', []); | 1071 const kStackOverflowBoilerplate = MakeRangeError('stack_overflow', []); |
| OLD | NEW |