| 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 getter_must_be_callable: ["Getter must be a function: ", "%0"], | 188 getter_must_be_callable: ["Getter must be a function: ", "%0"], |
| 189 setter_must_be_callable: ["Setter must be a function: ", "%0"], | 189 setter_must_be_callable: ["Setter must be a function: ", "%0"], |
| 190 value_and_accessor: ["Invalid property. A property cannot both
have accessors and be writable or have a value: ", "%0"], | 190 value_and_accessor: ["Invalid property. A property cannot both
have accessors and be writable or have a value: ", "%0"], |
| 191 proto_object_or_null: ["Object prototype may only be an Object or
null"], | 191 proto_object_or_null: ["Object prototype may only be an Object or
null"], |
| 192 property_desc_object: ["Property description must be an object: ",
"%0"], | 192 property_desc_object: ["Property description must be an object: ",
"%0"], |
| 193 redefine_disallowed: ["Cannot redefine property: ", "%0"], | 193 redefine_disallowed: ["Cannot redefine property: ", "%0"], |
| 194 define_disallowed: ["Cannot define property:", "%0", ", object
is not extensible."], | 194 define_disallowed: ["Cannot define property:", "%0", ", object
is not extensible."], |
| 195 non_extensible_proto: ["%0", " is not extensible"], | 195 non_extensible_proto: ["%0", " is not extensible"], |
| 196 handler_non_object: ["Proxy.", "%0", " called with non-object as
handler"], | 196 handler_non_object: ["Proxy.", "%0", " called with non-object as
handler"], |
| 197 handler_trap_missing: ["Proxy handler ", "%0", " has no '", "%1",
"' trap"], | 197 handler_trap_missing: ["Proxy handler ", "%0", " has no '", "%1",
"' trap"], |
| 198 handler_failed: ["Proxy handler ", "%0", " returned false fo
r '", "%1", "' trap"], | 198 handler_trap_must_be_callable: ["Proxy handler ", "%0", " has non-callable
'", "%1", "' trap"], |
| 199 handler_returned_false: ["Proxy handler ", "%0", " returned false fo
r '", "%1", "' trap"], |
| 200 handler_returned_undefined: ["Proxy handler ", "%0", " returned undefine
d for '", "%1", "' trap"], |
| 199 proxy_prop_not_configurable: ["Trap ", "%1", " of proxy handler ", "%0",
" returned non-configurable descriptor for property ", "%2"], | 201 proxy_prop_not_configurable: ["Trap ", "%1", " of proxy handler ", "%0",
" returned non-configurable descriptor for property ", "%2"], |
| 200 proxy_non_object_prop_names: ["Trap ", "%1", " returned non-object ", "%0
"], | 202 proxy_non_object_prop_names: ["Trap ", "%1", " returned non-object ", "%0
"], |
| 201 proxy_repeated_prop_name: ["Trap ", "%1", " returned repeated property
name ", "%2"], | 203 proxy_repeated_prop_name: ["Trap ", "%1", " returned repeated property
name ", "%2"], |
| 202 // RangeError | 204 // RangeError |
| 203 invalid_array_length: ["Invalid array length"], | 205 invalid_array_length: ["Invalid array length"], |
| 204 stack_overflow: ["Maximum call stack size exceeded"], | 206 stack_overflow: ["Maximum call stack size exceeded"], |
| 205 // SyntaxError | 207 // SyntaxError |
| 206 unable_to_parse: ["Parse error"], | 208 unable_to_parse: ["Parse error"], |
| 207 duplicate_regexp_flag: ["Duplicate RegExp flag ", "%0"], | 209 duplicate_regexp_flag: ["Duplicate RegExp flag ", "%0"], |
| 208 invalid_regexp: ["Invalid RegExp pattern /", "%0", "/"], | 210 invalid_regexp: ["Invalid RegExp pattern /", "%0", "/"], |
| (...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1043 var raw_stack = %CollectStackTrace(cons_opt | 1045 var raw_stack = %CollectStackTrace(cons_opt |
| 1044 ? cons_opt | 1046 ? cons_opt |
| 1045 : captureStackTrace, stackTraceLimit); | 1047 : captureStackTrace, stackTraceLimit); |
| 1046 DefineOneShotAccessor(obj, 'stack', function (obj) { | 1048 DefineOneShotAccessor(obj, 'stack', function (obj) { |
| 1047 return FormatRawStackTrace(obj, raw_stack); | 1049 return FormatRawStackTrace(obj, raw_stack); |
| 1048 }); | 1050 }); |
| 1049 }; | 1051 }; |
| 1050 | 1052 |
| 1051 $Math.__proto__ = global.Object.prototype; | 1053 $Math.__proto__ = global.Object.prototype; |
| 1052 | 1054 |
| 1053 DefineError(function Error() { }); | 1055 // DefineError is a native function. Use explicit receiver. Otherwise |
| 1054 DefineError(function TypeError() { }); | 1056 // the receiver will be 'undefined'. |
| 1055 DefineError(function RangeError() { }); | 1057 this.DefineError(function Error() { }); |
| 1056 DefineError(function SyntaxError() { }); | 1058 this.DefineError(function TypeError() { }); |
| 1057 DefineError(function ReferenceError() { }); | 1059 this.DefineError(function RangeError() { }); |
| 1058 DefineError(function EvalError() { }); | 1060 this.DefineError(function SyntaxError() { }); |
| 1059 DefineError(function URIError() { }); | 1061 this.DefineError(function ReferenceError() { }); |
| 1062 this.DefineError(function EvalError() { }); |
| 1063 this.DefineError(function URIError() { }); |
| 1060 | 1064 |
| 1061 $Error.captureStackTrace = captureStackTrace; | 1065 $Error.captureStackTrace = captureStackTrace; |
| 1062 | 1066 |
| 1063 // Setup extra properties of the Error.prototype object. | 1067 // Setup extra properties of the Error.prototype object. |
| 1064 function setErrorMessage() { | 1068 function setErrorMessage() { |
| 1065 var desc = {value: '', | 1069 var desc = {value: '', |
| 1066 enumerable: false, | 1070 enumerable: false, |
| 1067 configurable: true, | 1071 configurable: true, |
| 1068 writable: true }; | 1072 writable: true }; |
| 1069 DefineOwnProperty($Error.prototype, | 1073 DefineOwnProperty($Error.prototype, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1115 else throw e; | 1119 else throw e; |
| 1116 } | 1120 } |
| 1117 } | 1121 } |
| 1118 | 1122 |
| 1119 | 1123 |
| 1120 InstallFunctions($Error.prototype, DONT_ENUM, ['toString', errorToString]); | 1124 InstallFunctions($Error.prototype, DONT_ENUM, ['toString', errorToString]); |
| 1121 | 1125 |
| 1122 // Boilerplate for exceptions for stack overflows. Used from | 1126 // Boilerplate for exceptions for stack overflows. Used from |
| 1123 // Isolate::StackOverflow(). | 1127 // Isolate::StackOverflow(). |
| 1124 const kStackOverflowBoilerplate = MakeRangeError('stack_overflow', []); | 1128 const kStackOverflowBoilerplate = MakeRangeError('stack_overflow', []); |
| OLD | NEW |