Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Unified Diff: src/globals.h

Issue 1467473002: Install ConstructNonConstructable as construct stub for non-constructables. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/factory.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/factory.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698