Skip to content

Commit

Permalink
XS: Compartment tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Soquet committed Jan 5, 2022
1 parent f3b2e8b commit 8020161
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion xs/sources/xsDebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1658,7 +1658,8 @@ txSlot* fxFindRealm(txMachine* the)
txSlot* instance = function->value.reference;
txSlot* home = mxFunctionInstanceHome(instance);
txSlot* module = home->value.home.module;
realm = mxModuleInstanceInternal(module)->value.module.realm;
if (module)
realm = mxModuleInstanceInternal(module)->value.module.realm;
}
}
if (!realm)
Expand Down
5 changes: 3 additions & 2 deletions xs/sources/xsModule.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void fxBuildModule(txMachine* the)
slot = fxNextHostFunctionProperty(the, slot, mxCallback(fx_Compartment_prototype_import), 1, mxID(_import), XS_DONT_ENUM_FLAG);
slot = fxNextHostFunctionProperty(the, slot, mxCallback(fx_Compartment_prototype_importNow), 1, mxID(_importNow), XS_DONT_ENUM_FLAG);
slot = fxNextHostFunctionProperty(the, slot, mxCallback(fx_Compartment_prototype_module), 1, mxID(_module), XS_DONT_ENUM_FLAG);
slot = fxNextStringXProperty(the, slot, "Compartment", mxID(_Symbol_toStringTag), XS_GET_ONLY);
slot = fxNextStringXProperty(the, slot, "Compartment", mxID(_Symbol_toStringTag), XS_DONT_ENUM_FLAG | XS_DONT_SET_FLAG);
mxCompartmentPrototype = *the->stack;
slot = fxBuildHostConstructor(the, mxCallback(fx_Compartment), 1, mxID(_Compartment));
mxCompartmentConstructor = *the->stack;
Expand All @@ -187,6 +187,7 @@ void fxBuildModule(txMachine* the)
mxPush(mxObjectPrototype);
slot = fxLastProperty(the, fxNewObjectInstance(the));
slot = fxNextHostAccessorProperty(the, slot, mxCallback(fx_StaticModuleRecord_prototype_get_bindings), C_NULL, mxID(_bindings), XS_DONT_ENUM_FLAG);
slot = fxNextStringXProperty(the, slot, "StaticModuleRecord", mxID(_Symbol_toStringTag), XS_DONT_ENUM_FLAG | XS_DONT_SET_FLAG);
mxStaticModuleRecordPrototype = *the->stack;
slot = fxBuildHostConstructor(the, mxCallback(fx_StaticModuleRecord), 1, mxID(_StaticModuleRecord));
mxStaticModuleRecordConstructor = *the->stack;
Expand Down Expand Up @@ -1992,7 +1993,7 @@ void fx_Compartment_prototype_evaluate(txMachine* the)
stream.slot = mxArgv(0);
stream.offset = 0;
stream.size = mxStringLength(fxToString(the, mxArgv(0)));
fxRunScript(the, fxParseScript(the, &stream, fxStringGetter, mxStrictFlag | mxProgramFlag | mxEvalFlag | mxDebugFlag), mxRealmGlobal(realm), C_NULL, mxRealmClosures(realm)->value.reference, C_NULL, program);
fxRunScript(the, fxParseScript(the, &stream, fxStringGetter, mxStrictFlag | mxProgramFlag | mxDebugFlag), mxRealmGlobal(realm), C_NULL, mxRealmClosures(realm)->value.reference, C_NULL, program);
mxPullSlot(mxResult);
}
}
Expand Down

0 comments on commit 8020161

Please sign in to comment.