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

Unified Diff: src/parsing/preparser.h

Issue 2423053002: Install the 'name' property in classes at runtime (Closed)
Patch Set: Check for 'name' properties at parse-time Created 4 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
Index: src/parsing/preparser.h
diff --git a/src/parsing/preparser.h b/src/parsing/preparser.h
index c9227bae3f6441462bae1e0fd9c4c16079e2a26b..b4b44ffe2787cae5d1d4586fd7f25c32fb17075e 100644
--- a/src/parsing/preparser.h
+++ b/src/parsing/preparser.h
@@ -67,6 +67,9 @@ class PreParserIdentifier {
static PreParserIdentifier Async() {
return PreParserIdentifier(kAsyncIdentifier);
}
+ static PreParserIdentifier Name() {
+ return PreParserIdentifier(kNameIdentifier);
+ }
bool IsEmpty() const { return type_ == kEmptyIdentifier; }
bool IsEval() const { return type_ == kEvalIdentifier; }
bool IsArguments() const { return type_ == kArgumentsIdentifier; }
@@ -79,6 +82,7 @@ class PreParserIdentifier {
bool IsConstructor() const { return type_ == kConstructorIdentifier; }
bool IsEnum() const { return type_ == kEnumIdentifier; }
bool IsAwait() const { return type_ == kAwaitIdentifier; }
+ bool IsName() const { return type_ == kNameIdentifier; }
bool IsFutureStrictReserved() const {
return type_ == kFutureStrictReservedIdentifier ||
type_ == kLetIdentifier || type_ == kStaticIdentifier ||
@@ -109,7 +113,8 @@ class PreParserIdentifier {
kConstructorIdentifier,
kEnumIdentifier,
kAwaitIdentifier,
- kAsyncIdentifier
+ kAsyncIdentifier,
+ kNameIdentifier
};
explicit PreParserIdentifier(Type type) : type_(type), string_(nullptr) {}
@@ -1131,6 +1136,10 @@ class PreParser : public ParserBase<PreParser> {
return identifier.IsConstructor();
}
+ V8_INLINE bool IsName(PreParserIdentifier identifier) const {
+ return identifier.IsName();
+ }
+
V8_INLINE bool IsDirectEvalCall(PreParserExpression expression) const {
return expression.IsDirectEvalCall();
}

Powered by Google App Engine
This is Rietveld 408576698