fix(muscript): don't evaluate name twice in object path of Get
This commit is contained in:
parent
cfc6402788
commit
21a7cfcc39
|
@ -37,7 +37,7 @@ public class Get extends DynamicExpr {
|
||||||
DObject o = left.asObject();
|
DObject o = left.asObject();
|
||||||
var n = name.asStringExpr().get(dataRoot);
|
var n = name.asStringExpr().get(dataRoot);
|
||||||
if (!o.has(n)) throw new LocationalException(location, "Object does not contain \"" + n + "\"");
|
if (!o.has(n)) throw new LocationalException(location, "Object does not contain \"" + n + "\"");
|
||||||
return o.get(name.asStringExpr().get(dataRoot));
|
return o.get(n);
|
||||||
} else if (left.isList()) {
|
} else if (left.isList()) {
|
||||||
DList l = left.asList();
|
DList l = left.asList();
|
||||||
int idx = name.asNumberExpr().get(dataRoot).intValue();
|
int idx = name.asNumberExpr().get(dataRoot).intValue();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user