OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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/messages.h" | 5 #include "src/messages.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/api.h" | 9 #include "src/api.h" |
10 #include "src/execution.h" | 10 #include "src/execution.h" |
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 return msg; | 877 return msg; |
878 } | 878 } |
879 | 879 |
880 } // namespace | 880 } // namespace |
881 | 881 |
882 // static | 882 // static |
883 MaybeHandle<Object> ErrorUtils::MakeGenericError( | 883 MaybeHandle<Object> ErrorUtils::MakeGenericError( |
884 Isolate* isolate, Handle<JSFunction> constructor, int template_index, | 884 Isolate* isolate, Handle<JSFunction> constructor, int template_index, |
885 Handle<Object> arg0, Handle<Object> arg1, Handle<Object> arg2, | 885 Handle<Object> arg0, Handle<Object> arg1, Handle<Object> arg2, |
886 FrameSkipMode mode) { | 886 FrameSkipMode mode) { |
887 // This function used to be implemented in JavaScript, and JSEntryStub clears | 887 if (FLAG_clear_exceptions_on_js_entry) { |
888 // any pending exceptions - so whenever we'd call this from C++, pending | 888 // This function used to be implemented in JavaScript, and JSEntryStub |
889 // exceptions would be cleared. Preserve this behavior. | 889 // clears |
890 isolate->clear_pending_exception(); | 890 // any pending exceptions - so whenever we'd call this from C++, pending |
| 891 // exceptions would be cleared. Preserve this behavior. |
| 892 isolate->clear_pending_exception(); |
| 893 } |
891 | 894 |
892 DCHECK(mode != SKIP_UNTIL_SEEN); | 895 DCHECK(mode != SKIP_UNTIL_SEEN); |
893 | 896 |
894 Handle<Object> no_caller; | 897 Handle<Object> no_caller; |
895 Handle<String> msg = FormatMessage(isolate, template_index, arg0, arg1, arg2); | 898 Handle<String> msg = FormatMessage(isolate, template_index, arg0, arg1, arg2); |
896 return ErrorUtils::Construct(isolate, constructor, constructor, msg, mode, | 899 return ErrorUtils::Construct(isolate, constructor, constructor, msg, mode, |
897 no_caller, false); | 900 no_caller, false); |
898 } | 901 } |
899 | 902 |
900 #define SET_CALLSITE_PROPERTY(target, key, value) \ | 903 #define SET_CALLSITE_PROPERTY(target, key, value) \ |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1177 builder.AppendCString(" ("); | 1180 builder.AppendCString(" ("); |
1178 RETURN_ON_EXCEPTION( | 1181 RETURN_ON_EXCEPTION( |
1179 isolate, AppendFileLocation(isolate, recv, &call_site, &builder), String); | 1182 isolate, AppendFileLocation(isolate, recv, &call_site, &builder), String); |
1180 builder.AppendCString(")"); | 1183 builder.AppendCString(")"); |
1181 | 1184 |
1182 RETURN_RESULT(isolate, builder.Finish(), String); | 1185 RETURN_RESULT(isolate, builder.Finish(), String); |
1183 } | 1186 } |
1184 | 1187 |
1185 } // namespace internal | 1188 } // namespace internal |
1186 } // namespace v8 | 1189 } // namespace v8 |
OLD | NEW |