| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1130 %IgnoreAttributesAndSetProperty(this, 'stack', void 0, DONT_ENUM); | 1130 %IgnoreAttributesAndSetProperty(this, 'stack', void 0, DONT_ENUM); |
| 1131 %IgnoreAttributesAndSetProperty(this, 'arguments', void 0, DONT_ENUM); | 1131 %IgnoreAttributesAndSetProperty(this, 'arguments', void 0, DONT_ENUM); |
| 1132 %IgnoreAttributesAndSetProperty(this, 'type', void 0, DONT_ENUM); | 1132 %IgnoreAttributesAndSetProperty(this, 'type', void 0, DONT_ENUM); |
| 1133 if (m === kAddMessageAccessorsMarker) { | 1133 if (m === kAddMessageAccessorsMarker) { |
| 1134 // DefineOneShotAccessor always inserts a message property and | 1134 // DefineOneShotAccessor always inserts a message property and |
| 1135 // ignores setters. | 1135 // ignores setters. |
| 1136 DefineOneShotAccessor(this, 'message', function (obj) { | 1136 DefineOneShotAccessor(this, 'message', function (obj) { |
| 1137 return FormatMessage(%NewMessageObject(obj.type, obj.arguments)); | 1137 return FormatMessage(%NewMessageObject(obj.type, obj.arguments)); |
| 1138 }); | 1138 }); |
| 1139 } else if (!IS_UNDEFINED(m)) { | 1139 } else if (!IS_UNDEFINED(m)) { |
| 1140 %IgnoreAttributesAndSetProperty(this, | 1140 %IgnoreAttributesAndSetProperty( |
| 1141 'message', | 1141 this, |
| 1142 ToString(m), | 1142 'message', |
| 1143 DONT_ENUM); | 1143 (m instanceof $Error) ? m.stack : ToString(m), |
| 1144 DONT_ENUM); |
| 1144 } | 1145 } |
| 1145 captureStackTrace(this, f); | 1146 captureStackTrace(this, f); |
| 1146 } else { | 1147 } else { |
| 1147 return new f(m); | 1148 return new f(m); |
| 1148 } | 1149 } |
| 1149 }); | 1150 }); |
| 1150 %SetNativeFlag(f); | 1151 %SetNativeFlag(f); |
| 1151 } | 1152 } |
| 1152 | 1153 |
| 1153 DefineError(function Error() { }); | 1154 DefineError(function Error() { }); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 throw e; | 1208 throw e; |
| 1208 } | 1209 } |
| 1209 } | 1210 } |
| 1210 | 1211 |
| 1211 | 1212 |
| 1212 InstallFunctions($Error.prototype, DONT_ENUM, ['toString', ErrorToString]); | 1213 InstallFunctions($Error.prototype, DONT_ENUM, ['toString', ErrorToString]); |
| 1213 | 1214 |
| 1214 // Boilerplate for exceptions for stack overflows. Used from | 1215 // Boilerplate for exceptions for stack overflows. Used from |
| 1215 // Isolate::StackOverflow(). | 1216 // Isolate::StackOverflow(). |
| 1216 const kStackOverflowBoilerplate = MakeRangeError('stack_overflow', []); | 1217 const kStackOverflowBoilerplate = MakeRangeError('stack_overflow', []); |
| OLD | NEW |