Index: src/preparser.cc |
diff --git a/src/preparser.cc b/src/preparser.cc |
index 7e75e78ef9c2e0753c26e6f8bf9f5303ddc02f70..48f228d97e74a2abc8e3930d59bd5b3de84883dd 100644 |
--- a/src/preparser.cc |
+++ b/src/preparser.cc |
@@ -262,6 +262,14 @@ void PreParser::ParseStatementList(int end_token, bool* ok, |
} else if (use_strong_found) { |
scope_->SetLanguageMode(static_cast<LanguageMode>( |
scope_->language_mode() | STRONG)); |
+ if (i::IsConstructor(function_state_->kind())) { |
+ // "use strong" cannot occur in a class constructor body, to avoid |
+ // unintuitive strong class object semantics. |
+ PreParserTraits::ReportMessageAt( |
+ token_loc, MessageTemplate::kStrongConstructorDirective); |
+ *ok = false; |
+ return; |
+ } |
} else if (!statement.IsStringLiteral()) { |
directive_prologue = false; |
} |