Index: src/crankshaft/hydrogen.cc |
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc |
index c59c8e5337afe750648fd5c50154e505f3fc672c..f7d2f1ed8a61ccfb9520dfdc17683255868304f3 100644 |
--- a/src/crankshaft/hydrogen.cc |
+++ b/src/crankshaft/hydrogen.cc |
@@ -7021,7 +7021,11 @@ void HOptimizedGraphBuilder::HandleCompoundAssignment(Assignment* expr) { |
case CONST: |
return Bailout(kNonInitializerAssignmentToConst); |
case CONST_LEGACY: |
- return ast_context()->ReturnValue(Pop()); |
+ if (is_strict(function_language_mode())) { |
+ return Bailout(kNonInitializerAssignmentToConst); |
+ } else { |
+ return ast_context()->ReturnValue(Pop()); |
+ } |
default: |
mode = HStoreContextSlot::kNoCheck; |
} |
@@ -7089,7 +7093,9 @@ void HOptimizedGraphBuilder::VisitAssignment(Assignment* expr) { |
return Bailout(kNonInitializerAssignmentToConst); |
} |
} else if (var->mode() == CONST_LEGACY) { |
- if (expr->op() != Token::INIT) { |
+ if (expr->op() != Token::INIT && is_strict(function_language_mode())) { |
+ return Bailout(kNonInitializerAssignmentToConst); |
+ } else if (expr->op() != Token::INIT) { |
CHECK_ALIVE(VisitForValue(expr->value())); |
return ast_context()->ReturnValue(Pop()); |
} |