| Index: src/preparser.cc
|
| diff --git a/src/preparser.cc b/src/preparser.cc
|
| index 76f4625f3c69e647057e5aeef6cb1bf8514dbe26..ee6c900bcec54b59100e929d4da79353b570d1d9 100644
|
| --- a/src/preparser.cc
|
| +++ b/src/preparser.cc
|
| @@ -193,8 +193,19 @@ void PreParser::ParseStatementList(int end_token, bool* ok) {
|
| if (directive_prologue && peek() != Token::STRING) {
|
| directive_prologue = false;
|
| }
|
| + Token::Value token = peek();
|
| + Scanner::Location old_super_loc = function_state_->super_call_location();
|
| Statement statement = ParseStatementListItem(ok);
|
| if (!*ok) return;
|
| + Scanner::Location super_loc = function_state_->super_call_location();
|
| + if (is_strong(language_mode()) &&
|
| + i::IsConstructor(function_state_->kind()) &&
|
| + !old_super_loc.IsValid() && super_loc.IsValid() &&
|
| + token != Token::SUPER) {
|
| + ReportMessageAt(super_loc, "strong_super_call_nested");
|
| + *ok = false;
|
| + return;
|
| + }
|
| if (directive_prologue) {
|
| if (statement.IsUseStrictLiteral()) {
|
| scope_->SetLanguageMode(
|
| @@ -938,6 +949,15 @@ PreParser::Expression PreParser::ParseFunctionLiteral(
|
| CheckStrictOctalLiteral(start_position, end_position, CHECK_OK);
|
| }
|
|
|
| + if (is_strong(language_mode()) && IsSubclassConstructor(kind)) {
|
| + if (!function_state.super_call_location().IsValid()) {
|
| + ReportMessageAt(function_name_location, "strong_super_call_missing",
|
| + kReferenceError);
|
| + *ok = false;
|
| + return Expression::Default();
|
| + }
|
| + }
|
| +
|
| return Expression::Default();
|
| }
|
|
|
|
|