| 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 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 stack_trace_for_uncaught_exceptions_frame_limit_, | 1124 stack_trace_for_uncaught_exceptions_frame_limit_, |
| 1125 stack_trace_for_uncaught_exceptions_options_); | 1125 stack_trace_for_uncaught_exceptions_options_); |
| 1126 } | 1126 } |
| 1127 } | 1127 } |
| 1128 | 1128 |
| 1129 Handle<Object> exception_arg = exception_handle; | 1129 Handle<Object> exception_arg = exception_handle; |
| 1130 // If the exception argument is a custom object, turn it into a string | 1130 // If the exception argument is a custom object, turn it into a string |
| 1131 // before throwing as uncaught exception. Note that the pending | 1131 // before throwing as uncaught exception. Note that the pending |
| 1132 // exception object to be set later must not be turned into a string. | 1132 // exception object to be set later must not be turned into a string. |
| 1133 if (exception_arg->IsJSObject() && !IsErrorObject(exception_arg)) { | 1133 if (exception_arg->IsJSObject() && !IsErrorObject(exception_arg)) { |
| 1134 bool failed = false; | 1134 MaybeHandle<Object> maybe_exception = |
| 1135 exception_arg = | 1135 Execution::ToDetailString(this, exception_arg); |
| 1136 Execution::ToDetailString(this, exception_arg, &failed); | 1136 if (!maybe_exception.ToHandle(&exception_arg)) { |
| 1137 if (failed) { | |
| 1138 exception_arg = factory()->InternalizeOneByteString( | 1137 exception_arg = factory()->InternalizeOneByteString( |
| 1139 STATIC_ASCII_VECTOR("exception")); | 1138 STATIC_ASCII_VECTOR("exception")); |
| 1140 } | 1139 } |
| 1141 } | 1140 } |
| 1142 Handle<Object> message_obj = MessageHandler::MakeMessageObject( | 1141 Handle<Object> message_obj = MessageHandler::MakeMessageObject( |
| 1143 this, | 1142 this, |
| 1144 "uncaught_exception", | 1143 "uncaught_exception", |
| 1145 location, | 1144 location, |
| 1146 HandleVector<Object>(&exception_arg, 1), | 1145 HandleVector<Object>(&exception_arg, 1), |
| 1147 stack_trace_object); | 1146 stack_trace_object); |
| (...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2288 Handle<JSObject> obj = factory()->NewJSObjectFromMap(map); | 2287 Handle<JSObject> obj = factory()->NewJSObjectFromMap(map); |
| 2289 JSObject::NormalizeProperties(obj, KEEP_INOBJECT_PROPERTIES, 8); | 2288 JSObject::NormalizeProperties(obj, KEEP_INOBJECT_PROPERTIES, 8); |
| 2290 JSObject::SetProperty(registry, name, obj, NONE, STRICT).Assert(); | 2289 JSObject::SetProperty(registry, name, obj, NONE, STRICT).Assert(); |
| 2291 } | 2290 } |
| 2292 } | 2291 } |
| 2293 return Handle<JSObject>::cast(factory()->symbol_registry()); | 2292 return Handle<JSObject>::cast(factory()->symbol_registry()); |
| 2294 } | 2293 } |
| 2295 | 2294 |
| 2296 | 2295 |
| 2297 } } // namespace v8::internal | 2296 } } // namespace v8::internal |
| OLD | NEW |