Index: src/full-codegen/s390/full-codegen-s390.cc |
diff --git a/src/full-codegen/s390/full-codegen-s390.cc b/src/full-codegen/s390/full-codegen-s390.cc |
index 3cfd03074aedfce7eafdcf99b7e882ba652123e9..b6dc84c328db1439234b5003862bd851c0c152a7 100644 |
--- a/src/full-codegen/s390/full-codegen-s390.cc |
+++ b/src/full-codegen/s390/full-codegen-s390.cc |
@@ -2129,10 +2129,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. |
@@ -2147,8 +2147,8 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
__ CallRuntime(Runtime::kThrowReferenceError); |
__ 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()) { |
// Assignment to var. |
__ Push(var->name()); |
@@ -2169,12 +2169,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. |
} |
} |