Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
op(Op.GetComponentTagName, $s0),
op(Op.PrimitiveReference),
op(Op.Dup, $sp, 0),
]),
op(Op.JumpUnless, label('BODY')),
op(Op.Fetch, $s1),
op(Op.PutComponentOperations),
op(Op.OpenDynamicElement),
op(Op.DidCreateElement, $s0),
YieldBlock(attrsBlockNumber, EMPTY_ARRAY),
op(Op.FlushElement),
op('Label', 'BODY'),
InvokeStaticBlock(blockForLayout(layout)),
op(Op.Fetch, $s1),
op(Op.JumpUnless, label('END')),
op(Op.CloseElement),
op('Label', 'END'),
op(Op.Load, $s1),
op('StopLabels'),
];
}
vm.elements().popRemoteElement();
});
APPEND_OPCODES.add(Op.FlushElement, vm => {
let operations = check(vm.fetchValue($t0), CheckOperations);
let modifiers: Option<[ModifierManager, unknown][]> = null;
if (operations) {
modifiers = operations.flush(vm);
vm.loadValue($t0, null);
}
vm.elements().flushElement(modifiers);
});
APPEND_OPCODES.add(Op.CloseElement, vm => {
let modifiers = vm.elements().closeElement();
if (modifiers) {
modifiers.forEach(([manager, modifier]) => {
vm.env.scheduleInstallModifier(modifier, manager);
let d = manager.getDestructor(modifier);
if (d) {
vm.associateDestroyable(d);
}
});
}
});
APPEND_OPCODES.add(Op.Modifier, (vm, { op1: handle }) => {
let { manager, state } = vm.runtime.resolver.resolve(handle);
STATEMENTS.add(SexpOpcodes.CloseElement, () => op(Op.CloseElement));
STATEMENTS.add(SexpOpcodes.FlushElement, () => op(Op.FlushElement));
],
operands: 3,
check: true,
};
METADATA[Op.FlushElement] = {
name: 'FlushElement',
mnemonic: 'apnd_flushtag',
before: null,
stackChange: 0,
ops: [],
operands: 0,
check: true,
};
METADATA[Op.CloseElement] = {
name: 'CloseElement',
mnemonic: 'apnd_closetag',
before: null,
stackChange: 0,
ops: [],
operands: 0,
check: true,
};
METADATA[Op.PopRemoteElement] = {
name: 'PopRemoteElement',
mnemonic: 'apnd_closeremotetag',
before: null,
stackChange: 0,
ops: [],
operands: 0,