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

Function fxBuildAgent

xs/tools/xst.c:391–439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

389extern void modInstallBase64(xsMachine *the);
390
391void fxBuildAgent(xsMachine* the)
392{
393 txSlot* slot;
394 txSlot* agent;
395 txSlot* global;
396
397 slot = fxLastProperty(the, fxNewHostObject(the, NULL));
398 slot = fxNextHostFunctionProperty(the, slot, fx_agent_broadcast, 2, xsID("broadcast"), XS_DONT_ENUM_FLAG);
399 slot = fxNextHostFunctionProperty(the, slot, fx_agent_getReport, 0, xsID("getReport"), XS_DONT_ENUM_FLAG);
400 slot = fxNextHostFunctionProperty(the, slot, fx_agent_monotonicNow, 0, xsID("monotonicNow"), XS_DONT_ENUM_FLAG);
401 slot = fxNextHostFunctionProperty(the, slot, fx_agent_sleep, 1, xsID("sleep"), XS_DONT_ENUM_FLAG);
402 slot = fxNextHostFunctionProperty(the, slot, fx_agent_start, 1, xsID("start"), XS_DONT_ENUM_FLAG);
403 agent = the->stack;
404
405 mxPush(mxGlobal);
406 global = the->stack;
407
408 mxPush(mxObjectPrototype);
409 slot = fxLastProperty(the, fxNewObjectInstance(the));
410 slot = fxNextSlotProperty(the, slot, agent, xsID("agent"), XS_GET_ONLY);
411 slot = fxNextHostFunctionProperty(the, slot, fx_createRealm, 0, xsID("createRealm"), XS_DONT_ENUM_FLAG);
412 slot = fxNextHostFunctionProperty(the, slot, fx_detachArrayBuffer, 1, xsID("detachArrayBuffer"), XS_DONT_ENUM_FLAG);
413 slot = fxNextHostFunctionProperty(the, slot, fx_gc, 1, xsID("gc"), XS_DONT_ENUM_FLAG);
414 slot = fxNextHostFunctionProperty(the, slot, fx_evalScript, 1, xsID("evalScript"), XS_DONT_ENUM_FLAG);
415 slot = fxNextHostFunctionProperty(the, slot, fx_isLockedDown, 1, xsID("isLockedDown"), XS_DONT_ENUM_FLAG);
416 slot = fxNextHostFunctionProperty(the, slot, fx_metering, 1, xsID("metering"), XS_DONT_ENUM_FLAG);
417 slot = fxNextSlotProperty(the, slot, global, xsID("global"), XS_GET_ONLY);
418
419 slot = fxLastProperty(the, fxToInstance(the, global));
420 slot = fxNextSlotProperty(the, slot, the->stack, xsID("$262"), XS_DONT_ENUM_FLAG);
421 slot = fxNextHostFunctionProperty(the, slot, fx_print, 1, xsID("print"), XS_DONT_ENUM_FLAG);
422 slot = fxNextHostFunctionProperty(the, slot, fx_runScript, 1, xsID("runScript"), XS_DONT_ENUM_FLAG);
423 slot = fxNextHostFunctionProperty(the, slot, fx_clearTimer, 1, xsID("clearInterval"), XS_DONT_ENUM_FLAG);
424 slot = fxNextHostFunctionProperty(the, slot, fx_clearTimer, 1, xsID("clearTimeout"), XS_DONT_ENUM_FLAG);
425 slot = fxNextHostFunctionProperty(the, slot, fx_setInterval, 1, xsID("setInterval"), XS_DONT_ENUM_FLAG);
426 slot = fxNextHostFunctionProperty(the, slot, fx_setTimeout, 1, xsID("setTimeout"), XS_DONT_ENUM_FLAG);
427
428 slot = fxNextHostFunctionProperty(the, slot, fx_harden, 1, xsID("harden"), XS_DONT_ENUM_FLAG);
429 slot = fxNextHostFunctionProperty(the, slot, fx_lockdown, 0, xsID("lockdown"), XS_DONT_ENUM_FLAG);
430
431 slot = fxNextHostFunctionProperty(the, slot, fx_unicodeCompare, 2, xsID("unicodeCompare"), XS_DONT_ENUM_FLAG);
432
433 mxPop();
434 mxPop();
435
436 modInstallTextDecoder(the);
437 modInstallTextEncoder(the);
438 modInstallBase64(the);
439}
440
441void fxPrintUsage()
442{

Callers

nothing calls this directly

Calls 9

fxLastPropertyFunction · 0.85
fxNewHostObjectFunction · 0.85
fxNewObjectInstanceFunction · 0.85
fxNextSlotPropertyFunction · 0.85
fxToInstanceFunction · 0.85
modInstallTextDecoderFunction · 0.85
modInstallTextEncoderFunction · 0.85
modInstallBase64Function · 0.85

Tested by

no test coverage detected