Files
avmplus/utils/abcasm/test/callLocalByFunctionId.abs
dmcallis 65a0592776 Initial source code drop
Source code drop for the Actionscript virtual machine in the Adobe
Flash Player for December 2013
2013-12-02 16:04:04 -08:00

40 lines
764 B
Plaintext

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* Bind a function to a global slot; refer to it by .function_id
* in the newfunction instruction.
*/
.script_info {
init: .function_id(main)
traits : {
.trait { kind: Trait_Slot name: zarquon slot_id:1 type_name:* }
}
}
function main()
{
getlocal0
pushscope
newfunction .function_id(zarquon)
getglobalscope
swap
setslot 1
getglobalscope
getslot 1
getlocal0
call 0
returnvoid
}
function zarquon()
{
findpropstrict print
pushstring "hello, world."
callpropvoid print (1)
returnvoid
}