Index: src/globals.h |
diff --git a/src/globals.h b/src/globals.h |
index 5ccd40757da07b611c3a1dc12f16bbd0b831109d..79fb98c88c44733544dd570ee45d5310edc4a8d5 100644 |
--- a/src/globals.h |
+++ b/src/globals.h |
@@ -1097,7 +1097,11 @@ enum FunctionKind : uint16_t { |
kClassConstructor = |
kBaseConstructor | kDerivedConstructor | kDefaultConstructor, |
kAsyncArrowFunction = kArrowFunction | kAsyncFunction, |
- kAsyncConciseMethod = kAsyncFunction | kConciseMethod |
+ kAsyncConciseMethod = kAsyncFunction | kConciseMethod, |
+ |
+ // https://tc39.github.io/proposal-async-iteration/ |
+ kAsyncConciseGeneratorMethod = kAsyncFunction | kConciseGeneratorMethod, |
+ kAsyncGeneratorFunction = kAsyncFunction | kGeneratorFunction, |
}; |
inline bool IsValidFunctionKind(FunctionKind kind) { |
@@ -1116,7 +1120,9 @@ inline bool IsValidFunctionKind(FunctionKind kind) { |
kind == FunctionKind::kDerivedConstructor || |
kind == FunctionKind::kAsyncFunction || |
kind == FunctionKind::kAsyncArrowFunction || |
- kind == FunctionKind::kAsyncConciseMethod; |
+ kind == FunctionKind::kAsyncConciseMethod || |
+ kind == FunctionKind::kAsyncConciseGeneratorMethod || |
+ kind == FunctionKind::kAsyncGeneratorFunction; |
} |
@@ -1141,6 +1147,12 @@ inline bool IsAsyncFunction(FunctionKind kind) { |
return kind & FunctionKind::kAsyncFunction; |
} |
+inline bool IsAsyncGeneratorFunction(FunctionKind kind) { |
+ DCHECK(IsValidFunctionKind(kind)); |
+ const FunctionKind kMask = FunctionKind::kAsyncGeneratorFunction; |
+ return (kind & kMask) == kMask; |
+} |
+ |
inline bool IsResumableFunction(FunctionKind kind) { |
return IsGeneratorFunction(kind) || IsAsyncFunction(kind) || IsModule(kind); |
} |