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

Unified Diff: src/preparser.h

Issue 917933007: Make super() a syntax error in base class constructor (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: expand tests slightly Created 5 years, 10 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
« no previous file with comments | « no previous file | test/cctest/test-parsing.cc » ('j') | test/cctest/test-parsing.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index 141761d9c967e92ba5389824a55ae11a902dfd5c..fa72794159e07b7bc5c7818bb4bb8f9dc4407941 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -2752,8 +2752,8 @@ ParserBase<Traits>::ParseSuperExpression(bool is_new, bool* ok) {
return this->SuperReference(scope_, factory());
}
// new super() is never allowed.
- // super() is only allowed in constructor
- if (!is_new && peek() == Token::LPAREN && i::IsConstructor(kind)) {
+ // super() is only allowed in derived constructor
+ if (!is_new && peek() == Token::LPAREN && IsSubclassConstructor(kind)) {
scope_->RecordSuperConstructorCallUsage();
return this->SuperReference(scope_, factory());
}
« no previous file with comments | « no previous file | test/cctest/test-parsing.cc » ('j') | test/cctest/test-parsing.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698