Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可能遗漏了一些明显的东西,但是如何间接引用属性?例如在 javascript 中它会是:
if(propName in obj) return obj[propName];
如何在 haxe 中说同样的话?Dynamic<String>具体来说,所讨论的对象是flash.display.LoaderInfo.parameters。
Dynamic<String>
flash.display.LoaderInfo.parameters
非常感谢。
if(Reflect.hasField(obj, propName)) return Reflect.field(obj, propName);
虽然看起来代码更多,但生成的输出基本相同。