Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index f1d81ddd5fefa38f3704d11a6c1c7478f97e46c5..b2432cf895a02499ee677c4c5026e50e12b948f3 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -2568,6 +2568,19 @@ bool Value::IsRegExp() const { |
} |
+bool Value::IsGeneratorFunction() 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_generator(); |
+} |
+ |
+ |
+bool Value::IsGeneratorObject() const { |
+ return Utils::OpenHandle(this)->IsJSGeneratorObject(); |
+} |
+ |
+ |
Local<String> Value::ToString() const { |
i::Handle<i::Object> obj = Utils::OpenHandle(this); |
i::Handle<i::Object> str; |