R=arv@chromium.org, conradw@chromium.org
BUG=v8:3956
LOG=N
Review URL: https://codereview.chromium.org/
1180943007
Cr-Commit-Position: refs/heads/master@{#29026}
DEFINE_BOOL(strong_mode, false, "experimental strong language mode")
DEFINE_IMPLICATION(use_strong, strong_mode)
+DEFINE_BOOL(strong_this, true, "don't allow 'this' to escape from constructors")
DEFINE_BOOL(es_staging, false, "enable all completed harmony features")
DEFINE_BOOL(harmony, false, "enable all completed harmony features")
return nullptr;
case Token::THIS:
+ if (!FLAG_strong_this) break;
+ // Fall through.
case Token::SUPER:
if (is_strong(language_mode()) &&
i::IsConstructor(function_state_->kind())) {
return Statement::Default();
case Token::THIS:
+ if (!FLAG_strong_this) break;
+ // Fall through.
case Token::SUPER:
if (is_strong(language_mode()) &&
i::IsConstructor(function_state_->kind())) {
case Token::THIS: {
BindingPatternUnexpectedToken(classifier);
Consume(Token::THIS);
- if (is_strong(language_mode())) {
+ if (FLAG_strong_this && is_strong(language_mode())) {
// Constructors' usages of 'this' in strong mode are parsed separately.
// TODO(rossberg): this does not work with arrow functions yet.
if (i::IsConstructor(function_state_->kind())) {