UNPKG

@awayfl/avm2

Version:

Virtual machine for executing AS3 code

34 lines 1.28 kB
import { AXObject } from './AXObject'; export declare class HasNext2Info { object: AXObject; index: number; constructor(object: AXObject, index: number); /** * Determine if the given object has any more properties after the specified |index| and if so, * return the next index or |zero| otherwise. If the |obj| has no more properties then continue * the search in * |obj.__proto__|. This function returns an updated index and object to be used during * iteration. * * the |for (x in obj) { ... }| statement is compiled into the following pseudo bytecode: * * index = 0; * while (true) { * (obj, index) = hasNext2(obj, index); * if (index) { #1 * x = nextName(obj, index); #2 * } else { * break; * } * } * * #1 If we return zero, the iteration stops. * #2 The spec says we need to get the nextName at index + 1, but it's actually index - 1, this * caused me two hours of my life that I will probably never get back. * * TODO: We can't match the iteration order semantics of Action Script, hopefully programmers * don't rely on it. */ next(object: AXObject, index: number): void; } //# sourceMappingURL=HasNext2Info.d.ts.map