Skip to content

Commit

Permalink
XS: #627
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Soquet committed Apr 13, 2021
1 parent 8686b68 commit 04a9603
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions xs/sources/xsRun.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ static txBoolean fxRunDelete(txMachine* the, txSlot* instance, txID id, txIndex
static void fxRunDerived(txMachine* the);
static void fxRunExtends(txMachine* the);
static void fxRunForOf(txMachine* the);
static txBoolean fxRunHas(txMachine* the, txSlot* instance, txID id, txIndex index);
static void fxRunIn(txMachine* the);
static void fxRunProxy(txMachine* the, txSlot* instance);
static void fxRunInstanceOf(txMachine* the);
Expand Down Expand Up @@ -2282,10 +2283,12 @@ void fxRunID(txMachine* the, txSlot* generator, txInteger count)
index = XS_NO_ID;
mxNextCode(3);
if (mxFrame->flag & XS_STRICT_FLAG) {
if (!mxBehaviorHasProperty(the, variable, (txID)offset, index))
mxSaveState;
if (!fxRunHas(the, variable, (txID)offset, index))
mxRunDebugID(XS_REFERENCE_ERROR, "set %s: undefined variable", (txID)offset);
mxRestoreState;
}
mxSaveState;
mxSaveState;
slot = mxBehaviorSetProperty(the, variable, (txID)offset, index, XS_ANY);
mxRestoreState;
if (slot && (slot->kind < 0))
Expand Down Expand Up @@ -4323,6 +4326,15 @@ void fxRunForOf(txMachine* the)
fxEndHost(the);
}

txBoolean fxRunHas(txMachine* the, txSlot* instance, txID id, txIndex index)
{
txBoolean result;
fxBeginHost(the);
result = mxBehaviorHasProperty(the, instance, id, index);
fxEndHost(the);
return result;
}

void fxRunIn(txMachine* the)
{
txSlot* left = the->stack + 1;
Expand Down

0 comments on commit 04a9603

Please sign in to comment.