Skip to content

Commit

Permalink
Fixed implementation for array access expression visit function.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Sep 26, 2024
1 parent 4b42a64 commit 8b29178
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ast/expression/ArrayAccessExpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ DynamicObject ArrayAccessExpression::visit(SymbolTable& symbols) {
"Accessing string with non-number index is not allowed."
);

return DynamicObject(std::move(
return DynamicObject(
std::string(1, origin.getString().at((int) idx.getNumber()))
));
);
}
else if(origin.isArray()) {
if(!idx.isNumber())
Expand Down

0 comments on commit 8b29178

Please sign in to comment.