Index: src/full-codegen/mips64/full-codegen-mips64.cc |
diff --git a/src/full-codegen/mips64/full-codegen-mips64.cc b/src/full-codegen/mips64/full-codegen-mips64.cc |
index 6a136e7021d7ac53ba9bf20fba10eb2e807d1a13..f957895f01bf06c3786279e54789b14aa49c96d7 100644 |
--- a/src/full-codegen/mips64/full-codegen-mips64.cc |
+++ b/src/full-codegen/mips64/full-codegen-mips64.cc |
@@ -2172,10 +2172,10 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
__ CallRuntime(Runtime::kThrowReferenceError); |
__ bind(&assign); |
} |
- if (var->mode() == CONST) { |
- __ CallRuntime(Runtime::kThrowConstAssignError); |
- } else { |
+ if (var->mode() != CONST) { |
EmitStoreToStackLocalOrContextSlot(var, location); |
+ } else if (var->throw_on_const_assignment(language_mode())) { |
+ __ CallRuntime(Runtime::kThrowConstAssignError); |
} |
} else if (var->is_this() && var->mode() == CONST && op == Token::INIT) { |
// Initializing assignment to const {this} needs a write barrier. |
@@ -2191,7 +2191,8 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
__ bind(&uninitialized_this); |
EmitStoreToStackLocalOrContextSlot(var, location); |
- } else if (!var->is_const_mode() || op == Token::INIT) { |
+ } else { |
+ DCHECK(var->mode() != CONST || op == Token::INIT); |
if (var->IsLookupSlot()) { |
__ Push(var->name()); |
__ Push(v0); |
@@ -2211,13 +2212,6 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
} |
EmitStoreToStackLocalOrContextSlot(var, location); |
} |
- |
- } else { |
- DCHECK(var->mode() == CONST_LEGACY && op != Token::INIT); |
- if (is_strict(language_mode())) { |
- __ CallRuntime(Runtime::kThrowConstAssignError); |
- } |
- // Silently ignore store in sloppy mode. |
} |
} |