[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}
This commit is contained in:
parent
c30cc0722e
commit
494e2493f2
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user