UNPKG

@awayfl/avm2

Version:

Virtual machine for executing AS3 code

10 lines (9 loc) 475 B
import { AXObject } from '../run/AXObject'; import { assert } from '@awayjs/graphics'; import { defineNonEnumerableProperty, release } from '@awayfl/swf-loader'; export function addPrototypeFunctionAlias(object: AXObject, name: string, fun: Function) { release || assert(name.indexOf('$Bg') === 0); release || assert(typeof fun === 'function'); // REDUX: remove the need to box the function. defineNonEnumerableProperty(object, name, object.sec.AXFunction.axBox(fun)); }