Atom ProxyObject::getDescendants(const Multiname* name) const { GCRef<Toplevel> toplevel = this->toplevel(); GCRef<builtinClassManifest> builtinClasses = toplevel->builtinClasses(); GCRef<QNameObject> q = QNameObject::create(core()->GetGC(), builtinClasses->get_QNameClass(), *name); Atom argv[] = { atom(), q->atom() }; int const argc = 1; Binding b = builtinClasses->get_ProxyClass()->m_getDescendants; GCRef<MethodEnv> method = vtable->methods[AvmCore::bindingToMethodId(b)]; return method->coerceEnter(argc, argv); }
bool ProxyObject::deleteMultinameProperty(const Multiname* name) { GCRef<Toplevel> toplevel = this->toplevel(); GCRef<builtinClassManifest> builtinClasses = toplevel->builtinClasses(); GCRef<QNameObject> q = QNameObject::create(core()->GetGC(), builtinClasses->get_QNameClass(), *name); Atom argv[] = { atom(), q->atom() }; int const argc = 1; Binding b = builtinClasses->get_ProxyClass()->m_deleteProperty; GCRef<MethodEnv> method = vtable->methods[AvmCore::bindingToMethodId(b)]; return method->coerceEnter(argc, argv) != falseAtom; }
void ProxyObject::setMultinameProperty(const Multiname* name, Atom value) { GCRef<Toplevel> toplevel = this->toplevel(); GCRef<builtinClassManifest> builtinClasses = toplevel->builtinClasses(); GCRef<QNameObject> q = QNameObject::create(core()->GetGC(), builtinClasses->get_QNameClass(), *name); Atom argv[] = { atom(), q->atom(), value }; int const argc = 2; Binding b = builtinClasses->get_ProxyClass()->m_setProperty; GCRef<MethodEnv> method = vtable->methods[AvmCore::bindingToMethodId(b)]; method->coerceEnter(argc, argv); }
Atom ProxyObject::callProperty(const Multiname* name, int argc, Atom* argv) { GCRef<Toplevel> toplevel = this->toplevel(); GCRef<builtinClassManifest> builtinClasses = toplevel->builtinClasses(); int proxy_argc = argc+1; MMgc::GC::AllocaAutoPtr proxy_argv_autoptr; Atom* proxy_argv = (Atom*) avmStackAllocArray(core(), proxy_argv_autoptr, proxy_argc+1, sizeof(Atom)); GCRef<QNameObject> q = QNameObject::create(core()->GetGC(), builtinClasses->get_QNameClass(), *name); proxy_argv[0] = atom(); proxy_argv[1] = q->atom(); for (int i = 1; i <= argc; i++) { proxy_argv[i+1] = argv[i]; } Binding b = builtinClasses->get_ProxyClass()->m_callProperty; GCRef<MethodEnv> method = vtable->methods[AvmCore::bindingToMethodId(b)]; return method->coerceEnter(proxy_argc, proxy_argv); }
void AvmplusHostContext::throwInternalError(const char* msgz) { // FIXME - proper error ID? GCRef<ErrorObject> e = toplevel->errorClass()->constructObject(core->newStringUTF8(msgz)->atom(), core->intToAtom(0)); core->throwAtom(e->atom()); }