ObjectInterp.setVar

This commit is contained in:
2023-07-17 11:50:03 -06:00
parent d608beaf32
commit 450a27bfb9

View File

@@ -40,8 +40,16 @@ class ObjectInterp<T> extends Interp {
return super.resolve(id);
}
// TODO setting variables should try to set them on the object,
// but Interp.assign and Interp.evalAssignOp look very complicated to override
// TODO every method of setting variables should try to set them on the object,
// but there are a lot of them and I might have missed some.
override function setVar(name:String, v:Dynamic) {
if (Reflect.field(obj, name) != null) {
Reflect.setField(obj, name, v);
} else {
super.setVar(name, v);
}
}
}
/**