MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxDefaultFunctionPrototype

Function fxDefaultFunctionPrototype

xs/sources/xsFunction.c:168–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168void fxDefaultFunctionPrototype(txMachine* the)
169{
170 txSlot* instance;
171 txSlot* property;
172 instance = the->stack->value.reference;
173 instance->flag |= XS_CAN_CONSTRUCT_FLAG;
174 property = fxLastProperty(the, instance);
175 mxPush(mxObjectPrototype);
176 instance = fxNewObjectInstance(the);
177 fxNextSlotProperty(the, property, the->stack, mxID(_prototype), XS_DONT_DELETE_FLAG | XS_DONT_ENUM_FLAG);
178 mxPop();
179 fxNextSlotProperty(the, instance, the->stack, mxID(_constructor), XS_DONT_ENUM_FLAG);
180}
181
182txSlot* fxGetPrototypeFromConstructor(txMachine* the, txSlot* defaultPrototype)
183{

Callers 1

xsRun.cFile · 0.85

Calls 3

fxLastPropertyFunction · 0.85
fxNewObjectInstanceFunction · 0.85
fxNextSlotPropertyFunction · 0.85

Tested by

no test coverage detected