capture method
Implementation
HTVariableCell capture(int slot) {
final current = slots[slot];
if (current is HTVariableCell) {
return current;
}
final cell = HTVariableCell(
_name(slot),
current,
isMutable: _mutable[slot],
isInitialized: _initialized[slot],
);
slots[slot] = cell;
if (!capturedSlots.contains(slot)) {
capturedSlots = List<int>.of(capturedSlots)..add(slot);
}
_hasCapturedSlots = true;
return cell;
}