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

Unified Diff: src/parser.cc

Issue 1358423002: [es6] Introduce spec compliant IsConstructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix stupid fuzzer failure (constructor bit set on sloppy/strict arguments). Fix MIPS/MIPS64 typos, … Created 5 years, 3 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 | « src/objects-printer.cc ('k') | src/preparser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 123a7bdc6f636615b399530f15942846673ff85b..e3ce0f0172a4c340c0a904d30c6511b7b9bb476a 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -1280,9 +1280,8 @@ void* Parser::ParseStatementList(ZoneList<Statement*>* body, int end_token,
Scanner::Location old_super_loc = function_state_->super_location();
Statement* stat = ParseStatementListItem(CHECK_OK);
- if (is_strong(language_mode()) &&
- scope_->is_function_scope() &&
- i::IsConstructor(function_state_->kind())) {
+ if (is_strong(language_mode()) && scope_->is_function_scope() &&
+ IsClassConstructor(function_state_->kind())) {
Scanner::Location this_loc = function_state_->this_location();
Scanner::Location super_loc = function_state_->super_location();
if (this_loc.beg_pos != old_this_loc.beg_pos &&
@@ -1336,7 +1335,7 @@ void* Parser::ParseStatementList(ZoneList<Statement*>* body, int end_token,
if (use_strong_found) {
scope_->SetLanguageMode(
static_cast<LanguageMode>(scope_->language_mode() | STRONG));
- if (i::IsConstructor(function_state_->kind())) {
+ if (IsClassConstructor(function_state_->kind())) {
// "use strong" cannot occur in a class constructor body, to avoid
// unintuitive strong class object semantics.
ParserTraits::ReportMessageAt(
@@ -2642,7 +2641,7 @@ Statement* Parser::ParseExpressionOrLabelledStatement(
// Fall through.
case Token::SUPER:
if (is_strong(language_mode()) &&
- i::IsConstructor(function_state_->kind())) {
+ IsClassConstructor(function_state_->kind())) {
bool is_this = peek() == Token::THIS;
Expression* expr;
ExpressionClassifier classifier;
@@ -2849,7 +2848,7 @@ Statement* Parser::ParseReturnStatement(bool* ok) {
}
} else {
if (is_strong(language_mode()) &&
- i::IsConstructor(function_state_->kind())) {
+ IsClassConstructor(function_state_->kind())) {
int pos = peek_position();
ReportMessageAt(Scanner::Location(pos, pos + 1),
MessageTemplate::kStrongConstructorReturnValue);
@@ -4604,7 +4603,7 @@ ZoneList<Statement*>* Parser::ParseEagerFunctionBody(
// For concise constructors, check that they are constructed,
// not called.
- if (i::IsConstructor(kind)) {
+ if (IsClassConstructor(kind)) {
AddAssertIsConstruct(result, pos);
}
« no previous file with comments | « src/objects-printer.cc ('k') | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698