How to use the @glimmer/vm.Op.JumpIf 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
childScope.bindSymbol(locals![i], args.at(i));
        }

        invokingScope = childScope;
      }
    }

    vm.pushFrame();
    vm.pushScope(invokingScope);
    vm.call(handle!);
  },
  OpcodeKind.Mut
);

APPEND_OPCODES.add(
  Op.JumpIf,
  (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
let scope = vm.scope();

  for (let i=0; i {
  vm.goto(target);
});

APPEND_OPCODES.add(Op.JumpIf, (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));
  }
});