Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 8e88e65d517662db30a24af0b8b2a4b984acc1b8..1575559d38261ea41d1125377b18ee13f89c1353 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -1581,6 +1581,26 @@ THREADED_TEST(IsGeneratorFunctionOrObject) { |
CHECK(!func->IsGeneratorObject()); |
} |
+THREADED_TEST(IsAsyncFunction) { |
+ i::FLAG_harmony_async_await = true; |
+ LocalContext env; |
+ v8::Isolate* isolate = env->GetIsolate(); |
+ v8::HandleScope scope(isolate); |
+ |
+ CompileRun("async function foo() {}"); |
+ v8::Local<Value> foo = CompileRun("foo"); |
+ |
+ CHECK(foo->IsAsyncFunction()); |
+ CHECK(foo->IsFunction()); |
+ CHECK(!foo->IsGeneratorFunction()); |
+ CHECK(!foo->IsGeneratorObject()); |
+ |
+ CompileRun("function bar() {}"); |
+ v8::Local<Value> bar = CompileRun("bar"); |
+ |
+ CHECK(!bar->IsAsyncFunction()); |
+ CHECK(bar->IsFunction()); |
+} |
THREADED_TEST(ArgumentsObject) { |
LocalContext env; |