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

Function if

xs/sources/xsRun.c:931–961  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

929 }
930#if mxHostFunctionPrimitive
931 else if (slot->kind == XS_HOST_FUNCTION_KIND) {
932 if (byte)
933 mxRunDebug(XS_TYPE_ERROR, "new: not a constructor");
934 mxPushKind(XS_VAR_KIND);
935 mxStack->value.environment.variable.count = 0;
936#ifdef mxDebug
937 mxStack->ID = XS_NO_ID;
938 mxStack->value.environment.line = 0;
939#endif
940 mxFrame = mxStack + 1 + offset;
941 mxFrame->flag |= XS_C_FLAG;
942 mxScope = mxStack;
943 mxCode = C_NULL;
944 byte = XS_CODE_CALL;
945#ifdef mxTraceCall
946 fxTraceCallBegin(the, mxFrameFunction);
947#endif
948 mxSaveState;
949#ifdef mxLink
950 if ((txU1*)slot->value.hostFunction.builder->callback - (txU1*)the->fakeCallback < 0)
951 mxRunDebug(XS_TYPE_ERROR, "link: unavailable function");
952#endif
953 (*(slot->value.hostFunction.builder->callback))(the);
954 mxRestoreState;
955 if (mxCode) {
956 byte = *mxCode;
957 mxBreak;
958 }
959 slot = mxFrameResult;
960 goto XS_CODE_END_ALL;
961 }
962#endif
963 if (byte) {
964 mxRunDebug(XS_TYPE_ERROR, "new: not a constructor");

Callers

nothing calls this directly

Calls 7

fxTraceCallBeginFunction · 0.85
fxRunConstructorFunction · 0.85
fxDebugThrowFunction · 0.85
fxTraceExceptionFunction · 0.85
fxJumpFunction · 0.85
fxNewInstanceFunction · 0.85
fxNumberToIntegerFunction · 0.85

Tested by

no test coverage detected