Commit 494e2493 authored by neis's avatar neis Committed by Commit bot

[interpreter] Strengthen a DCHECK.

There are no CONST function declarations. Also make check independent of variable location.

R=adamk@chromium.org, rmcilroy@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2301863002
Cr-Commit-Position: refs/heads/master@{#39182}
parent c30cc072
......@@ -946,6 +946,7 @@ void BytecodeGenerator::VisitVariableDeclaration(VariableDeclaration* decl) {
void BytecodeGenerator::VisitFunctionDeclaration(FunctionDeclaration* decl) {
Variable* variable = decl->proxy()->var();
DCHECK(variable->mode() == LET || variable->mode() == VAR);
switch (variable->location()) {
case VariableLocation::UNALLOCATED: {
FeedbackVectorSlot slot = decl->proxy()->VariableFeedbackSlot();
......@@ -955,8 +956,6 @@ void BytecodeGenerator::VisitFunctionDeclaration(FunctionDeclaration* decl) {
case VariableLocation::PARAMETER:
case VariableLocation::LOCAL: {
VisitForAccumulatorValue(decl->fun());
DCHECK(variable->mode() == LET || variable->mode() == VAR ||
variable->mode() == CONST);
VisitVariableAssignment(variable, Token::INIT,
FeedbackVectorSlot::Invalid());
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment