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

Function fxNextHostAccessorProperty

xs/sources/xsProperty.c:49–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47
48#ifndef mxLink
49txSlot* fxNextHostAccessorProperty(txMachine* the, txSlot* property, txCallback get, txCallback set, txID id, txFlag flag)
50{
51 txSlot *getter = NULL, *setter = NULL, *home = the->stack, *slot;
52 if (get) {
53 getter = fxBuildHostFunction(the, get, 0, XS_NO_ID);
54 slot = mxFunctionInstanceHome(getter);
55 slot->value.home.object = home->value.reference;
56 fxRenameFunction(the, getter, id, 0, XS_NO_ID, "get ");
57 }
58 if (set) {
59 setter = fxBuildHostFunction(the, set, 1, XS_NO_ID);
60 slot = mxFunctionInstanceHome(setter);
61 slot->value.home.object = home->value.reference;
62 fxRenameFunction(the, setter, id, 0, XS_NO_ID, "set ");
63 }
64 property = property->next = fxNewSlot(the);
65 property->flag = flag;
66 property->ID = id;
67 property->kind = XS_ACCESSOR_KIND;
68 property->value.accessor.getter = getter;
69 property->value.accessor.setter = setter;
70 if (set)
71 mxPop();
72 if (get)
73 mxPop();
74 return property;
75}
76
77txSlot* fxNextHostFunctionProperty(txMachine* the, txSlot* property, txCallback call, txInteger length, txID id, txFlag flag)
78{

Callers 11

fxBuildModuleFunction · 0.70
fxBuildMapSetFunction · 0.70
fxBuildGeneratorFunction · 0.70
fxBuildSymbolFunction · 0.70
fxBuildErrorFunction · 0.70
fxBuildRegExpFunction · 0.70
fxBuildArrayFunction · 0.70
fxBuildObjectFunction · 0.70
fxBuildDataViewFunction · 0.70
fxBuildAtomicsFunction · 0.70
fxBuildPromiseFunction · 0.70

Calls 3

fxBuildHostFunctionFunction · 0.85
fxRenameFunctionFunction · 0.85
fxNewSlotFunction · 0.85

Tested by

no test coverage detected