OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 "src/builtins/builtins.h" | 5 #include "src/builtins/builtins.h" |
6 #include "src/builtins/builtins-utils.h" | 6 #include "src/builtins/builtins-utils.h" |
7 | 7 |
8 #include "src/messages.h" | 8 #include "src/messages.h" |
9 #include "src/property-descriptor.h" | 9 #include "src/property-descriptor.h" |
10 #include "src/string-builder.h" | 10 #include "src/string-builder.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 // Collect the stack trace. | 49 // Collect the stack trace. |
50 | 50 |
51 RETURN_FAILURE_ON_EXCEPTION(isolate, | 51 RETURN_FAILURE_ON_EXCEPTION(isolate, |
52 isolate->CaptureAndSetDetailedStackTrace(object)); | 52 isolate->CaptureAndSetDetailedStackTrace(object)); |
53 | 53 |
54 // Eagerly format the stack trace and set the stack property. | 54 // Eagerly format the stack trace and set the stack property. |
55 | 55 |
56 Handle<Object> stack_trace = | 56 Handle<Object> stack_trace = |
57 isolate->CaptureSimpleStackTrace(object, mode, caller); | 57 isolate->CaptureSimpleStackTrace(object, mode, caller); |
58 if (!stack_trace->IsJSArray()) return *isolate->factory()->undefined_value(); | 58 if (!stack_trace->IsJSArray()) return isolate->heap()->undefined_value(); |
59 | 59 |
60 Handle<Object> formatted_stack_trace; | 60 Handle<Object> formatted_stack_trace; |
61 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 61 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
62 isolate, formatted_stack_trace, | 62 isolate, formatted_stack_trace, |
63 ErrorUtils::FormatStackTrace(isolate, object, stack_trace)); | 63 ErrorUtils::FormatStackTrace(isolate, object, stack_trace)); |
64 | 64 |
65 PropertyDescriptor desc; | 65 PropertyDescriptor desc; |
66 desc.set_configurable(true); | 66 desc.set_configurable(true); |
67 desc.set_writable(true); | 67 desc.set_writable(true); |
68 desc.set_value(formatted_stack_trace); | 68 desc.set_value(formatted_stack_trace); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 Handle<Object> undefined = isolate->factory()->undefined_value(); | 126 Handle<Object> undefined = isolate->factory()->undefined_value(); |
127 const int template_index = MessageTemplate::kURIMalformed; | 127 const int template_index = MessageTemplate::kURIMalformed; |
128 RETURN_RESULT_OR_FAILURE( | 128 RETURN_RESULT_OR_FAILURE( |
129 isolate, | 129 isolate, |
130 ErrorUtils::MakeGenericError(isolate, constructor, template_index, | 130 ErrorUtils::MakeGenericError(isolate, constructor, template_index, |
131 undefined, undefined, undefined, SKIP_NONE)); | 131 undefined, undefined, undefined, SKIP_NONE)); |
132 } | 132 } |
133 | 133 |
134 } // namespace internal | 134 } // namespace internal |
135 } // namespace v8 | 135 } // namespace v8 |
OLD | NEW |