| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdlib.h> | 5 #include <stdlib.h> |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #include "src/ast.h" | 9 #include "src/ast.h" |
| 10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
| (...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1050 if (!bootstrapping) { | 1050 if (!bootstrapping) { |
| 1051 Handle<JSArray> stack_trace_object; | 1051 Handle<JSArray> stack_trace_object; |
| 1052 if (capture_stack_trace_for_uncaught_exceptions_) { | 1052 if (capture_stack_trace_for_uncaught_exceptions_) { |
| 1053 if (IsErrorObject(exception_handle)) { | 1053 if (IsErrorObject(exception_handle)) { |
| 1054 // We fetch the stack trace that corresponds to this error object. | 1054 // We fetch the stack trace that corresponds to this error object. |
| 1055 Handle<Name> key = factory()->detailed_stack_trace_symbol(); | 1055 Handle<Name> key = factory()->detailed_stack_trace_symbol(); |
| 1056 // Look up as own property. If the lookup fails, the exception is | 1056 // Look up as own property. If the lookup fails, the exception is |
| 1057 // probably not a valid Error object. In that case, we fall through | 1057 // probably not a valid Error object. In that case, we fall through |
| 1058 // and capture the stack trace at this throw site. | 1058 // and capture the stack trace at this throw site. |
| 1059 LookupIterator lookup(exception_handle, key, | 1059 LookupIterator lookup(exception_handle, key, |
| 1060 LookupIterator::CHECK_PROPERTY); | 1060 LookupIterator::OWN_PROPERTY); |
| 1061 Handle<Object> stack_trace_property; | 1061 Handle<Object> stack_trace_property; |
| 1062 if (Object::GetProperty(&lookup).ToHandle(&stack_trace_property) && | 1062 if (Object::GetProperty(&lookup).ToHandle(&stack_trace_property) && |
| 1063 stack_trace_property->IsJSArray()) { | 1063 stack_trace_property->IsJSArray()) { |
| 1064 stack_trace_object = Handle<JSArray>::cast(stack_trace_property); | 1064 stack_trace_object = Handle<JSArray>::cast(stack_trace_property); |
| 1065 } | 1065 } |
| 1066 } | 1066 } |
| 1067 if (stack_trace_object.is_null()) { | 1067 if (stack_trace_object.is_null()) { |
| 1068 // Not an error object, we capture at throw site. | 1068 // Not an error object, we capture at throw site. |
| 1069 stack_trace_object = CaptureCurrentStackTrace( | 1069 stack_trace_object = CaptureCurrentStackTrace( |
| 1070 stack_trace_for_uncaught_exceptions_frame_limit_, | 1070 stack_trace_for_uncaught_exceptions_frame_limit_, |
| (...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2415 if (prev_ && prev_->Intercept(flag)) return true; | 2415 if (prev_ && prev_->Intercept(flag)) return true; |
| 2416 // Then check whether this scope intercepts. | 2416 // Then check whether this scope intercepts. |
| 2417 if ((flag & intercept_mask_)) { | 2417 if ((flag & intercept_mask_)) { |
| 2418 intercepted_flags_ |= flag; | 2418 intercepted_flags_ |= flag; |
| 2419 return true; | 2419 return true; |
| 2420 } | 2420 } |
| 2421 return false; | 2421 return false; |
| 2422 } | 2422 } |
| 2423 | 2423 |
| 2424 } } // namespace v8::internal | 2424 } } // namespace v8::internal |
| OLD | NEW |