Index: src/execution.h |
diff --git a/src/execution.h b/src/execution.h |
index f26ea343082b93f68d1ac088971bef15880adc7b..ee5d3a6f738f2e8336c13ca18b0f4ba5565cc287 100644 |
--- a/src/execution.h |
+++ b/src/execution.h |
@@ -15,6 +15,9 @@ namespace internal { |
class Execution final : public AllStatic { |
public: |
+ // Whether to report pending messages, or keep them pending on the isolate. |
+ enum class MessageHandling { kReport, kKeepPending }; |
+ |
// Call a function, the caller supplies a receiver and an array |
// of arguments. |
// |
@@ -36,16 +39,18 @@ class Execution final : public AllStatic { |
int argc, |
Handle<Object> argv[]); |
- // Call a function, just like Call(), but make sure to silently catch |
- // any thrown exceptions. The return value is either the result of |
- // calling the function (if caught exception is false) or the exception |
- // that occurred (if caught exception is true). |
- // In the exception case, exception_out holds the caught exceptions, unless |
- // it is a termination exception. |
+ // Call a function, just like Call(), but handle don't report exceptions |
+ // externally. |
+ // The return value is either the result of calling the function (if no |
+ // exception occurred), or an empty handle. |
+ // If message_handling is MessageHandling::kReport, exceptions (except for |
+ // termination exceptions) will be stored in exception_out (if not a |
+ // nullptr). |
static MaybeHandle<Object> TryCall(Isolate* isolate, Handle<Object> callable, |
Handle<Object> receiver, int argc, |
Handle<Object> argv[], |
- MaybeHandle<Object>* exception_out = NULL); |
+ MessageHandling message_handling, |
+ MaybeHandle<Object>* exception_out); |
}; |