How to use the @glimmer/vm.Op.JumpUnless function in @glimmer/vm

To help you get started, we’ve selected a few @glimmer/vm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github glimmerjs / glimmer-vm / packages / @glimmer / runtime / lib / compiled / opcodes / vm.ts View on Github external
if (isConst(reference)) {
    if (reference.value()) {
      vm.goto(target);
    }
  } else {
    let cache = new ReferenceCache(reference);

    if (cache.peek()) {
      vm.goto(target);
    }

    vm.updateWith(new Assert(cache));
  }
});

APPEND_OPCODES.add(Op.JumpUnless, (vm, { op1: target }) => {
  let reference = check(vm.stack.pop(), CheckReference);

  if (isConst(reference)) {
    if (!reference.value()) {
      vm.goto(target);
    }
  } else {
    let cache = new ReferenceCache(reference);

    if (!cache.peek()) {
      vm.goto(target);
    }

    vm.updateWith(new Assert(cache));
  }
});
github glimmerjs / glimmer-vm / packages / @glimmer / runtime / lib / compiled / opcodes / vm.ts View on Github external
}
    } else {
      let cache = new ReferenceCache(reference);

      if (cache.peek()) {
        vm.goto(target);
      }

      vm.updateWith(new Assert(cache));
    }
  },
  OpcodeKind.Mut
);

APPEND_OPCODES.add(
  Op.JumpUnless,
  (vm, { op1: target }) => {
    let reference = check(vm.stack.pop(), CheckReference);

    if (isConst(reference)) {
      if (!reference.value()) {
        vm.goto(target);
      }
    } else {
      let cache = new ReferenceCache(reference);

      if (!cache.peek()) {
        vm.goto(target);
      }

      vm.updateWith(new Assert(cache));
    }