UNPKG

@awayfl/avm2

Version:

Virtual machine for executing AS3 code

14 lines (13 loc) 346 B
/** * Same as |axCoerceString| except for returning "null" instead of |null| for * |null| or |undefined|, and calls |toString| instead of (implicitly) |valueOf|. */ export function axCoerceName(x) { if (typeof x === 'string') { return x; } else if (x == undefined) { return 'null'; } return x.toString(); }