diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-09-07 11:47:51 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-09-07 10:32:15 +0000 |
commit | e99c203b77743fe7554663c12a98960d8514fb6b (patch) | |
tree | ff1d36effac6e7efc255f418fb2f418aea56baf4 /src/qml/compiler/qv4codegen.cpp | |
parent | e45eca9058bd475060637143188a4466faf487d9 (diff) |
Use the correct enum value instead of hard coded ints
Change-Id: I2d65fe6fb3d9f299f5aeff1542c7dc1d2db8b012
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index c90787acc8..5c91b51b91 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -646,7 +646,7 @@ void Codegen::destructureElementList(const Codegen::Reference &array, PatternEle array.loadInAccumulator(); Instruction::GetIterator iteratorObjInstr; - iteratorObjInstr.iterator = 1; // ForEachType::Of + iteratorObjInstr.iterator = static_cast<int>(AST::ForEachType::Of); bytecodeGenerator->addInstruction(iteratorObjInstr); iterator.storeConsumeAccumulator(); @@ -1128,7 +1128,7 @@ bool Codegen::visit(ArrayPattern *ast) expr.loadInAccumulator(); Instruction::GetIterator iteratorObjInstr; - iteratorObjInstr.iterator = /*ForEachType::Of*/ 1; + iteratorObjInstr.iterator = static_cast<int>(AST::ForEachType::Of); bytecodeGenerator->addInstruction(iteratorObjInstr); iterator.storeConsumeAccumulator(); } @@ -2844,7 +2844,7 @@ bool Codegen::visit(YieldExpression *ast) expr.loadInAccumulator(); Instruction::GetIterator getIterator; - getIterator.iterator = /*ForEachType::Of*/ 1; + getIterator.iterator = static_cast<int>(AST::ForEachType::Of); bytecodeGenerator->addInstruction(getIterator); iterator.storeConsumeAccumulator(); Instruction::LoadUndefined load; @@ -3212,7 +3212,7 @@ bool Codegen::visit(ForEachStatement *ast) expr.loadInAccumulator(); Instruction::GetIterator iteratorObjInstr; - iteratorObjInstr.iterator = (ast->type == ForEachType::Of) ? 1 : 0; + iteratorObjInstr.iterator = static_cast<int>(ast->type); bytecodeGenerator->addInstruction(iteratorObjInstr); iterator.storeConsumeAccumulator(); } |