Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getTag({ args: { tag }, component }: EmberishGlimmerComponentState): Tag {
return combine([tag, getSelf(component).tag]);
}
constructor(
public tag: Tag,
private manager: InternalModifierManager,
private modifier: ModifierInstanceState
) {
super();
this.lastUpdated = value(tag);
}
evaluate(vm: UpdatingVM) {
let { manager, modifier, tag, lastUpdated } = this;
if (!validate(tag, lastUpdated)) {
vm.env.scheduleUpdateModifier(modifier, manager);
this.lastUpdated = value(tag);
}
}
}
evaluate(vm: UpdatingVM) {
let { attribute, reference, tag } = this;
if (!validate(tag, this.lastRevision)) {
attribute.update(reference.value(), vm.env);
this.lastRevision = value(tag);
}
}
}
constructor(private reference: VersionedReference, private attribute: DynamicAttribute) {
super();
let { tag } = reference;
this.tag = tag;
this.lastRevision = value(tag);
}
dirty() {
dirty(this.tag);
}
update(value: T) {
let { inner } = this;
if (value !== inner) {
dirty(this.tag);
this.inner = value;
}
}
forceUpdate(value: T) {
dirty(this.tag);
this.inner = value;
}
APPEND_OPCODES.add(Op.DynamicAttr, (vm, { op1: _name, op2: trusting, op3: _namespace }) => {
let name = vm[CONSTANTS].getString(_name);
let reference = check(vm.stack.pop(), CheckReference);
let value = reference.value();
let namespace = _namespace ? vm[CONSTANTS].getString(_namespace) : null;
let attribute = vm.elements().setDynamicAttribute(name, value, !!trusting, namespace);
if (!isConst(reference)) {
vm.updateWith(new UpdateDynamicAttributeOpcode(reference, attribute));
}
});
APPEND_OPCODES.add(Op.PushRemoteElement, vm => {
let elementRef = check(vm.stack.pop(), CheckReference);
let insertBeforeRef = check(vm.stack.pop(), CheckReference);
let guidRef = check(vm.stack.pop(), CheckReference);
let element: SimpleElement;
let insertBefore: Maybe;
let guid = guidRef.value() as string;
if (isConst(elementRef)) {
element = check(elementRef.value(), CheckElement);
} else {
let cache = new ReferenceCache(elementRef as Reference);
element = check(cache.peek(), CheckElement);
vm.updateWith(new Assert(cache));
}
if (insertBeforeRef.value() !== undefined) {
if (isConst(insertBeforeRef)) {
insertBefore = check(insertBeforeRef.value(), CheckOption(CheckNode));
} else {
let cache = new ReferenceCache(insertBeforeRef as Reference>);
insertBefore = check(cache.peek(), CheckOption(CheckNode));
vm.updateWith(new Assert(cache));
}
}