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 "src/accessors.h" | 5 #include "src/accessors.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/contexts.h" | 8 #include "src/contexts.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/execution.h" | 10 #include "src/execution.h" |
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1125 MaybeHandle<JSReceiver> ClearInternalStackTrace(Isolate* isolate, | 1125 MaybeHandle<JSReceiver> ClearInternalStackTrace(Isolate* isolate, |
1126 Handle<JSObject> error) { | 1126 Handle<JSObject> error) { |
1127 RETURN_ON_EXCEPTION( | 1127 RETURN_ON_EXCEPTION( |
1128 isolate, | 1128 isolate, |
1129 JSReceiver::SetProperty(error, isolate->factory()->stack_trace_symbol(), | 1129 JSReceiver::SetProperty(error, isolate->factory()->stack_trace_symbol(), |
1130 isolate->factory()->undefined_value(), STRICT), | 1130 isolate->factory()->undefined_value(), STRICT), |
1131 JSReceiver); | 1131 JSReceiver); |
1132 return error; | 1132 return error; |
1133 } | 1133 } |
1134 | 1134 |
1135 MaybeHandle<Object> FormatStackTrace(Isolate* isolate, Handle<JSObject> error, | |
1136 Handle<Object> stack_trace) { | |
1137 // TODO(jgruber): Port FormatStackTrace from JS. | |
1138 Handle<JSFunction> fun = isolate->error_format_stack_trace(); | |
1139 | |
1140 int argc = 2; | |
1141 ScopedVector<Handle<Object>> argv(argc); | |
1142 argv[0] = error; | |
1143 argv[1] = stack_trace; | |
1144 | |
1145 Handle<Object> formatted_stack_trace; | |
1146 ASSIGN_RETURN_ON_EXCEPTION( | |
1147 isolate, formatted_stack_trace, | |
1148 Execution::Call(isolate, fun, error, argc, argv.start()), Object); | |
1149 | |
1150 return formatted_stack_trace; | |
1151 } | |
1152 | |
1153 bool IsAccessor(Handle<Object> receiver, Handle<Name> name, | 1135 bool IsAccessor(Handle<Object> receiver, Handle<Name> name, |
1154 Handle<JSObject> holder) { | 1136 Handle<JSObject> holder) { |
1155 LookupIterator it(receiver, name, holder, | 1137 LookupIterator it(receiver, name, holder, |
1156 LookupIterator::OWN_SKIP_INTERCEPTOR); | 1138 LookupIterator::OWN_SKIP_INTERCEPTOR); |
1157 // Skip any access checks we might hit. This accessor should never hit in a | 1139 // Skip any access checks we might hit. This accessor should never hit in a |
1158 // situation where the caller does not have access. | 1140 // situation where the caller does not have access. |
1159 if (it.state() == LookupIterator::ACCESS_CHECK) { | 1141 if (it.state() == LookupIterator::ACCESS_CHECK) { |
1160 CHECK(it.HasAccess()); | 1142 CHECK(it.HasAccess()); |
1161 it.Next(); | 1143 it.Next(); |
1162 } | 1144 } |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1245 Handle<AccessorInfo> Accessors::ErrorStackInfo(Isolate* isolate, | 1227 Handle<AccessorInfo> Accessors::ErrorStackInfo(Isolate* isolate, |
1246 PropertyAttributes attributes) { | 1228 PropertyAttributes attributes) { |
1247 Handle<AccessorInfo> info = | 1229 Handle<AccessorInfo> info = |
1248 MakeAccessor(isolate, isolate->factory()->stack_string(), | 1230 MakeAccessor(isolate, isolate->factory()->stack_string(), |
1249 &ErrorStackGetter, &ErrorStackSetter, attributes); | 1231 &ErrorStackGetter, &ErrorStackSetter, attributes); |
1250 return info; | 1232 return info; |
1251 } | 1233 } |
1252 | 1234 |
1253 } // namespace internal | 1235 } // namespace internal |
1254 } // namespace v8 | 1236 } // namespace v8 |
OLD | NEW |