table.copy
Copy elements from one table to another. You can copy elements from and to the same table.
Syntax
table.copy $destinationTable $sourceTable
Parameters
$destinationTable Optional
If there is no source and destination tables given then the default table is used.
If used then this points to a (table...)
object to copy the elements to.
$sourceTable Optional
This points to a (table...)
object to copy the elements from.
If the destination is given then this is required too.
Stack In
i32 |
The offset within the destination table to copy to. |
i32 |
The offset within the source table to copy from. |
i32 |
The number of elements in the table to copy. |
Example
(table $tableFrom 10 funcref)
(table $tableTo 10 funcref)
(func $copyTable
i32.const 4
i32.const 2
i32.const 6
table.copy $tableTo $tableFrom
)