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

Function fxDefineAll

xs/sources/xsAPI.c:1140–1159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1138}
1139
1140void fxDefineAll(txMachine* the, txSlot* stack, txID id, txIndex index, txFlag flag, txFlag mask)
1141{
1142 txSlot* instance = fxToInstance(the, stack);
1143 txSlot* slot = stack + 1;
1144 if (mask & XS_GETTER_FLAG) {
1145 slot->value.accessor.getter = slot->value.reference;
1146 slot->value.accessor.setter = C_NULL;
1147 slot->kind = XS_ACCESSOR_KIND;
1148 }
1149 else if (mask & XS_SETTER_FLAG) {
1150 slot->value.accessor.setter = slot->value.reference;
1151 slot->value.accessor.getter = C_NULL;
1152 slot->kind = XS_ACCESSOR_KIND;
1153 }
1154 slot->flag = flag & XS_GET_ONLY;
1155 if (!mxBehaviorDefineOwnProperty(the, instance, id, index, slot, mask))
1156 mxTypeError("define %ld: not configurable", id);
1157 the->stack = stack;
1158 mxPop();
1159}
1160
1161void fxDefineAt(txMachine* the, txFlag flag, txFlag mask)
1162{

Callers 3

fxDefineAtFunction · 0.85
fxDefineIDFunction · 0.85
fxDefineIndexFunction · 0.85

Calls 1

fxToInstanceFunction · 0.85

Tested by

no test coverage detected