void ClassClosure::set_prototype(Atom value) { // ISSUE can value be null/undefined? if (AvmCore::isNullOrUndefined(value)) { setPrototypePtr(NULL); } else { if (!AvmCore::isObject(value)) { toplevel()->throwTypeError(kPrototypeTypeError); } // allow any prototype object. if the object has methods or slots, so be it setPrototypePtr(AvmCore::atomToScriptObject(value)); } }
ObjectClass::ObjectClass(VTable* cvtable) : ClassClosure(cvtable) { toplevel()->objectClass = this; // patch Object's instance vtable scope, since we created it earlier for // bootstrapping //ivtable()->scope = cvtable->scope; AvmAssert(traits()->getSizeOfInstance() == sizeof(ObjectClass)); // it is correct call construct() when this.prototype == null setPrototypePtr(construct()); }