Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
type: 'str',
},
{
name: 'trusting',
type: 'bool',
},
{
name: 'namespace',
type: 'option-str',
},
],
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,
attrsBlockNumber: number
): StatementCompileActions {
return [
op('StartLabels'),
WithSavedRegister($s1, () => [
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'),
];
}
STATEMENTS.add(SexpOpcodes.FlushElement, () => op(Op.FlushElement));
} else {
let cache = new ReferenceCache(insertBeforeRef as Reference>);
insertBefore = check(cache.peek(), CheckOption(CheckNode));
vm.updateWith(new Assert(cache));
}
}
let block = vm.elements().pushRemoteElement(element, guid, insertBefore);
if (block) vm.associateDestroyable(block);
});
APPEND_OPCODES.add(Op.PopRemoteElement, vm => {
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]) => {