Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 4df8e0a61714608ebdc59d3ecf1b218839a36fae..dd39c2c8a3b696a58bac968b2d21ebb5e9cda3d5 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -3384,6 +3384,12 @@ bool Value::IsRegExp() const { |
return obj->IsJSRegExp(); |
} |
+bool Value::IsAsyncFunction() const { |
+ i::Handle<i::Object> obj = Utils::OpenHandle(this); |
+ if (!obj->IsJSFunction()) return false; |
+ i::Handle<i::JSFunction> func = i::Handle<i::JSFunction>::cast(obj); |
+ return func->shared()->is_async(); |
+} |
bool Value::IsGeneratorFunction() const { |
i::Handle<i::Object> obj = Utils::OpenHandle(this); |