| 1406 | } |
| 1407 | |
| 1408 | void fxBuildCompartmentGlobals(txMachine* the) |
| 1409 | { |
| 1410 | txSlot* realm = mxProgram.value.reference->next->value.module.realm; |
| 1411 | txSlot* global = mxRealmGlobal(realm)->value.reference; |
| 1412 | txSlot* environment = mxRealmClosures(realm)->value.reference; |
| 1413 | txSlot* slot; |
| 1414 | txSlot* property; |
| 1415 | |
| 1416 | mxPush(mxObjectPrototype); |
| 1417 | property = fxLastProperty(the, fxNewHostObject(the, NULL)); |
| 1418 | slot = global->next->next; |
| 1419 | while (slot) { |
| 1420 | if (slot->ID > mxID(_globalThis)) { |
| 1421 | // fprintf(stderr, "%s\n", fxGetKeyName(the, slot->ID)); |
| 1422 | property = fxNextSlotProperty(the, property, slot, slot->ID, XS_NO_FLAG); |
| 1423 | } |
| 1424 | slot = slot->next; |
| 1425 | } |
| 1426 | slot = environment->next->next; |
| 1427 | while (slot) { |
| 1428 | if (slot->kind == XS_CLOSURE_KIND) { |
| 1429 | // fprintf(stderr, "%s\n", fxGetKeyName(the, slot->ID)); |
| 1430 | property = fxNextSlotProperty(the, property, slot->value.closure, slot->ID, XS_NO_FLAG); |
| 1431 | } |
| 1432 | slot = slot->next; |
| 1433 | } |
| 1434 | mxPullSlot(mxResult); |
| 1435 | } |
| 1436 | |
| 1437 | void fxLoadHook(txMachine* the) |
| 1438 | { |
no test coverage detected