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

Function fxProxyHasProperty

xs/sources/xsProxy.c:497–529  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

495}
496
497txBoolean fxProxyHasProperty(txMachine* the, txSlot* instance, txID id, txIndex index)
498{
499 txBoolean result;
500 mxProxyDeclarations(_has);
501 if (function) {
502 /* THIS */
503 mxPushSlot(handler);
504 /* FUNCTION */
505 mxPushSlot(function);
506 mxCall();
507 /* ARGUMENTS */
508 mxPushSlot(target);
509 mxPushUndefined();
510 fxKeyAt(the, id, index, the->stack);
511 mxRunCount(2);
512 result = fxToBoolean(the, the->stack);
513 mxPop();
514 if (!result) {
515 mxPushUndefined();
516 if (mxBehaviorGetOwnProperty(the, target->value.reference, id, index, the->stack)) {
517 if (the->stack->flag & XS_DONT_DELETE_FLAG)
518 mxTypeError("(proxy).has: false for non-configurable property");
519 if (!mxBehaviorIsExtensible(the, target->value.reference))
520 mxTypeError("(proxy).has: false for property of not extensible object");
521 }
522 mxPop();
523 }
524 }
525 else
526 result = mxBehaviorHasProperty(the, target->value.reference, id, index);
527 mxProxyPop();
528 return result;
529}
530
531txBoolean fxProxyIsExtensible(txMachine* the, txSlot* instance)
532{

Callers

nothing calls this directly

Calls 2

fxKeyAtFunction · 0.85
fxToBooleanFunction · 0.85

Tested by

no test coverage detected