Skip to content

Commit

Permalink
Allow array access byte in VBytes (i.e. haxe.io.Bytes)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiaomao committed Jul 23, 2024
1 parent 5384cbe commit 1b93b1e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hld/Eval.hx
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ class Eval {
case VArray(t, len, read, _):
var i = toInt(i);
return i < 0 || i >= len ? defVal(t) : read(i);
case VBytes(len, read, _):
var i = toInt(i);
return i < 0 || i >= len ? { v : VUndef, t : HUi8 } : { v : VInt(read(i)), t : HUi8 };
default:
}
throw "Can't access " + valueStr(v) + "[" + valueStr(i) + "]";
Expand Down

0 comments on commit 1b93b1e

Please sign in to comment.