@awayfl/avm2
Version:
Virtual machine for executing AS3 code
16 lines (14 loc) • 459 B
text/typescript
import { ASObject } from '../nat/ASObject';
export function forEachPublicProperty(
object: ASObject,
callbackfn: (property: any, value: any) => void,
thisArg?: any
) {
// REDUX: Do we need to walk the proto chain here?
const properties = object.axGetEnumerableKeys();
for (let i = 0; i < properties.length; i++) {
const property = properties[i];
const value = object.axGetPublicProperty(property);
callbackfn.call(thisArg, property, value);
}
}