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

Function fx_Object

xs/sources/xsObject.c:110–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110void fx_Object(txMachine* the)
111{
112 if (mxHasTarget && !fxIsSameSlot(the, mxTarget, mxFunction)) {
113 mxPushSlot(mxTarget);
114 fxGetPrototypeFromConstructor(the, &mxObjectPrototype);
115 fxNewObjectInstance(the);
116 mxPullSlot(mxResult);
117 return;
118 }
119 if ((mxArgc == 0) || (mxArgv(0)->kind == XS_UNDEFINED_KIND) || (mxArgv(0)->kind == XS_NULL_KIND)) {
120 mxPush(mxObjectPrototype);
121 fxNewObjectInstance(the);
122 mxPullSlot(mxResult);
123 return;
124 }
125 *mxResult = *mxArgv(0);
126 fxToInstance(the, mxResult);
127}
128
129void fx_Object_prototype___proto__get(txMachine* the)
130{

Callers

nothing calls this directly

Calls 4

fxIsSameSlotFunction · 0.85
fxNewObjectInstanceFunction · 0.85
fxToInstanceFunction · 0.85

Tested by

no test coverage detected