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

Unified Diff: src/globals.h

Issue 477263002: ES6: Add support for method shorthand in object literals (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 months 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
Index: src/globals.h
diff --git a/src/globals.h b/src/globals.h
index cc31be148751020bde24818b425ea3fb99097a22..912e484d2fb313236c2b5d078ed953882731698c 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -756,6 +756,29 @@ enum MinusZeroMode {
FAIL_ON_MINUS_ZERO
};
+
+enum FunctionKind {
+ kNormalFunction = 0,
+ kArrowFunction = 1,
+ kGeneratorFunction = 2,
+ kConciseMethod = 4
+};
+
+
+inline bool IsArrowFunction(FunctionKind kind) {
rossberg 2014/08/25 09:39:29 Each of these functions should assert that kind is
arv (Not doing code reviews) 2014/09/09 22:24:27 Done.
+ return kind & FunctionKind::kArrowFunction;
+}
+
+
+inline bool IsGeneratorFunction(FunctionKind kind) {
+ return kind & FunctionKind::kGeneratorFunction;
+}
+
+
+inline bool IsConciseMethod(FunctionKind kind) {
+ return kind & FunctionKind::kConciseMethod;
+}
+
} } // namespace v8::internal
namespace i = v8::internal;

Powered by Google App Engine
This is Rietveld 408576698