[...items, itemCount] → [array]
0x42
1+ → 1
5
@push(@stackArray(@pop()));
ActionInitArray initializes an array in a ScriptObject and is similar to ActionInitObject. The newly created object is pushed to the stack. The stack is the only existing reference to the newly created object. A subsequent SetVariable or SetMember action can store the newly created object in a variable.
Field | Type | Comment |
---|---|---|
ActionInitArray | ACTIONRECORDHEADER | ActionCode = 0x42 |
ActionInitArray pops elems and then [arg1, arg2, ..., argn] off the stack. ActionInitArray does the following:
For all of the call actions (ActionCallMethod, ActionNewMethod, ActionNewObject, and ActionCallFunction) and initialization actions (ActionInitObject and ActionInitArray), the arguments of the function are pushed onto the stack in reverse order, with the rightmost argument first and the leftmost argument last. The arguments are subsequently popped off in order (first to last).