UNPKG

@awayfl/avm2

Version:

Virtual machine for executing AS3 code

18 lines (17 loc) 518 B
import { release } from '@awayfl/swf-loader'; import { assert } from '@awayjs/graphics'; /** * Make sure we bottom out at the securityDomain's objectPrototype. */ export function safeGetPrototypeOf(object) { var axClass = object.axClass; if (!axClass || axClass === axClass.sec.AXObject) { return null; } var prototype = axClass.dPrototype; if (prototype === object) { prototype = axClass.superClass.dPrototype; } release || assert(prototype.sec); return prototype; }