Skip to content

Commit

Permalink
XS: bind getPrototypeOf
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Soquet committed May 2, 2022
1 parent ad44e61 commit 790cc80
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions xs/sources/xsFunction.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,13 @@ void fx_Function_prototype_bind(txMachine* the)
txSize c = mxArgc, i;

fxCheckCallable(the, mxThis);
if (function->value.instance.prototype) {
mxPushReference(function->value.instance.prototype);
mxPushNull();
if (mxBehaviorGetPrototype(the, function, the->stack))
instance = fxNewObjectInstance(the);
}
else
else {
mxPop();
instance = fxNewInstance(the);
}
instance->flag |= function->flag & (XS_CAN_CALL_FLAG | XS_CAN_CONSTRUCT_FLAG);
mxPullSlot(mxResult);

Expand Down

0 comments on commit 790cc80

Please sign in to comment.