Exemplo n.º 1
0
    /*static*/ CreateInstanceProc FASTCALL ClassClosure::checkForRestrictedInheritance(VTable* ivtable, CreateInstanceProc p)
    {
        if (ivtable)
        {
            Traits* itraits = ivtable->traits;
            if (p == ArrayClass::createInstanceProc && !itraits->needsHashtable())
            {
                // If we are a sealed subclass of Array, we want to check BugCompatibility
                // to see if instances of this class should behave as "semisealed" instead.
                if (!itraits->core->currentBugCompatibility()->bugzilla654807)
                {
                    return SemiSealedArrayObject::createInstanceProc;
                }
            }

            // Bugzilla 688486: if this is unsubclassed array, let it be simple.
            if (itraits == itraits->core->traits.array_itraits)
            {
                return ArrayClass::createUnsubclassedInstanceProc;
            }

            Traits* base = itraits->base;
            if (base != NULL && base->isRestrictedInheritance && base->pool != itraits->pool)
            {
                return ClassClosure::cantInstantiateCreateInstanceProc;
            }
        }
        return p;
    }
Exemplo n.º 2
0
 bool DomainObject::isDynamic (Atom a)
 {
     Traits *traits = getTraits(a);
     if (traits->itraits != NULL) {
         traits = traits->itraits;
     }
     return traits->needsHashtable();
 }