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

Function fxFreezeJSONModule

xs/tools/xsl.c:1008–1027  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1006}
1007
1008void fxFreezeJSONModule(txMachine* the)
1009{
1010 txSlot* instance = fxGetInstance(the, mxResult);
1011 txSlot* internal = instance->next;
1012 if (internal && (internal->kind == XS_MODULE_KIND) && (internal->flag & XS_JSON_MODULE_FLAG)) {
1013 txID defaultID = mxID(_default);
1014 txSlot* export = mxModuleInstanceExports(instance)->value.reference->next;
1015 if (export && (export->ID == defaultID)) {
1016 mxPush(mxObjectConstructor);
1017 mxDub();
1018 mxGetID(mxID(_freeze));
1019 mxCall();
1020 mxPushSlot(export->value.export.closure);
1021 mxPushBoolean(1);
1022 mxRunCount(2);
1023 mxPop();
1024 }
1025
1026 }
1027}
1028
1029void fxLoadModule(txMachine* the, txSlot* module, txID moduleID)
1030{

Callers 1

mainFunction · 0.85

Calls 1

fxGetInstanceFunction · 0.85

Tested by

no test coverage detected