UNPKG

@awayfl/avm2

Version:

Virtual machine for executing AS3 code

15 lines (14 loc) 387 B
import { axIsXMLCollection } from './axIsXMLCollection'; export function axTypeOf(x, sec) { // ABC doesn't box primitives, so typeof returns the primitive type even when // the value is new'd if (x) { if (x.value) { return typeof x.value; } if (axIsXMLCollection(x, sec)) { return 'xml'; } } return typeof x; }