Index: src/globals.h |
diff --git a/src/globals.h b/src/globals.h |
index 2b73cb04cf3073b6fd7a76c17a4c335a2f011784..67bdb63b86ee7a008e1fe0eebaab710c6d0eec60 100644 |
--- a/src/globals.h |
+++ b/src/globals.h |
@@ -1022,6 +1022,15 @@ inline bool IsClassConstructor(FunctionKind kind) { |
} |
+inline bool IsConstructable(FunctionKind kind, LanguageMode mode) { |
+ if (IsAccessorFunction(kind)) return false; |
+ if (IsConciseMethod(kind) && !IsGeneratorFunction(kind)) return false; |
+ if (IsArrowFunction(kind)) return false; |
+ if (is_strong(mode)) return IsClassConstructor(kind); |
+ return true; |
+} |
+ |
+ |
inline bool IsInObjectLiteral(FunctionKind kind) { |
DCHECK(IsValidFunctionKind(kind)); |
return kind & FunctionKind::kInObjectLiteral; |