EncodedJSValue jsTestNodeConstructor(ExecState* state, JSObject* baseValue, EncodedJSValue, PropertyName) { JSTestNodePrototype* domObject = jsDynamicCast<JSTestNodePrototype*>(baseValue); if (!domObject) return throwVMTypeError(state); return JSValue::encode(JSTestNode::getConstructor(state->vm(), domObject->globalObject())); }
bool setJSTestNodeConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) { JSValue value = JSValue::decode(encodedValue); JSTestNodePrototype* domObject = jsDynamicCast<JSTestNodePrototype*>(JSValue::decode(thisValue)); if (UNLIKELY(!domObject)) { throwVMTypeError(state); return false; } // Shadowing a built-in constructor return domObject->putDirect(state->vm(), state->propertyNames().constructor, value); }
static JSTestNodePrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure) { JSTestNodePrototype* ptr = new (NotNull, JSC::allocateCell<JSTestNodePrototype>(vm.heap)) JSTestNodePrototype(vm, globalObject, structure); ptr->finishCreation(vm); return ptr; }