Пример #1
0
    bool ProxyObject::hasUintProperty(uint32_t i) const
    {
        GCRef<Toplevel> toplevel = this->toplevel();
        GCRef<builtinClassManifest> builtinClasses = toplevel->builtinClasses();
        Binding b = builtinClasses->get_ProxyClass()->m_hasProperty;
        Atom argv[] = { atom(), core()->internUint32(i)->atom() };
        int const argc = 1;

        GCRef<MethodEnv> method = vtable->methods[AvmCore::bindingToMethodId(b)];
        return method->coerceEnter(argc, argv) != falseAtom;
    }
Пример #2
0
    bool ProxyObject::deleteAtomProperty(Atom name)
    {
        GCRef<Toplevel> toplevel = this->toplevel();
        GCRef<builtinClassManifest> builtinClasses = toplevel->builtinClasses();
        Binding b = builtinClasses->get_ProxyClass()->m_deleteProperty;
        Atom argv[] = { atom(), name };
        int const argc = 1;

        GCRef<MethodEnv> method = vtable->methods[AvmCore::bindingToMethodId(b)];
        return method->coerceEnter(argc, argv) != falseAtom;
    }
Пример #3
0
    void ProxyObject::setAtomProperty(Atom name, Atom value)
    {
        GCRef<Toplevel> toplevel = this->toplevel();
        GCRef<builtinClassManifest> builtinClasses = toplevel->builtinClasses();
        Binding b = builtinClasses->get_ProxyClass()->m_setProperty;
        Atom argv[3] = { atom(), name, value };
        int const argc = 2;

        GCRef<MethodEnv> method = vtable->methods[AvmCore::bindingToMethodId(b)];
        method->coerceEnter(argc, argv);
    }
Пример #4
0
    Atom ProxyObject::nextValue(int index)
    {
        GCRef<Toplevel> toplevel = this->toplevel();
        GCRef<builtinClassManifest> builtinClasses = toplevel->builtinClasses();
        Atom argv[] = { atom(), core()->intToAtom (index) };
        int const argc = 1;
        
        Binding b = builtinClasses->get_ProxyClass()->m_nextValue;

        GCRef<MethodEnv> method = vtable->methods[AvmCore::bindingToMethodId(b)];
        return method->coerceEnter(argc, argv);
    }
Пример #5
0
    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);
    }
Пример #6
0
    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;
    }
Пример #7
0
    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);
    }
Пример #8
0
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);
}