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

Function fxProxyDeleteProperty

xs/sources/xsProxy.c:308–340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306}
307
308txBoolean fxProxyDeleteProperty(txMachine* the, txSlot* instance, txID id, txIndex index)
309{
310 txBoolean result;
311 mxProxyDeclarations(_deleteProperty);
312 if (function) {
313 /* THIS */
314 mxPushSlot(handler);
315 /* FUNCTION */
316 mxPushSlot(function);
317 mxCall();
318 /* ARGUMENTS */
319 mxPushSlot(target);
320 mxPushUndefined();
321 fxKeyAt(the, id, index, the->stack);
322 mxRunCount(2);
323 result = fxToBoolean(the, the->stack);
324 mxPop();
325 if (result) {
326 mxPushUndefined();
327 if (mxBehaviorGetOwnProperty(the, target->value.reference, id, index, the->stack)) {
328 if (the->stack->flag & XS_DONT_DELETE_FLAG)
329 mxTypeError("(proxy).deleteProperty: true for non-configurable property");
330 if (!mxBehaviorIsExtensible(the, target->value.reference))
331 mxTypeError("(proxy).deleteProperty: true for non-extensible object");
332 }
333 mxPop();
334 }
335 }
336 else
337 result = mxBehaviorDeleteProperty(the, target->value.reference, id, index);
338 mxProxyPop();
339 return result;
340}
341
342txBoolean fxProxyGetOwnProperty(txMachine* the, txSlot* instance, txID id, txIndex index, txSlot* slot)
343{

Callers

nothing calls this directly

Calls 2

fxKeyAtFunction · 0.85
fxToBooleanFunction · 0.85

Tested by

no test coverage detected