How to use the @glimmer/interfaces.Op.GetProperty function in @glimmer/interfaces

To help you get started, we’ve selected a few @glimmer/interfaces 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 / opcode-compiler / lib / syntax / push-resolution.ts View on Github external
let name = context.meta.upvars![freeVar];

        concatExpressions(encoder, context, [op(Op.ResolveMaybeLocal, name)], constants);

        break;
      }

      switch (expressionContext) {
        case ExpressionContext.Expression: {
          // in classic mode, this is always a this-fallback
          let name = context.meta.upvars![freeVar];

          concatExpressions(
            encoder,
            context,
            [op(Op.GetVariable, 0), op(Op.GetProperty, name)],
            constants
          );

          break;
        }

        case ExpressionContext.AppendSingleId: {
          let resolver = context.syntax.program.resolverDelegate;
          let name = context.meta.upvars![freeVar];

          let resolvedHelper = resolver.lookupHelper(name, context.meta.referrer);
          let expressions: ExpressionCompileActions;

          if (resolvedHelper) {
            expressions = Call({ handle: resolvedHelper, params: null, hash: null });
          } else {
github glimmerjs / glimmer-vm / packages / @glimmer / debug / lib / opcode-metadata.ts View on Github external
METADATA[Op.GetVariable] = {
  name: 'GetVariable',
  mnemonic: 'symload',
  before: null,
  stackChange: 1,
  ops: [
    {
      name: 'symbol',
      type: 'u32',
    },
  ],
  operands: 1,
  check: true,
};

METADATA[Op.GetProperty] = {
  name: 'GetProperty',
  mnemonic: 'getprop',
  before: null,
  stackChange: 0,
  ops: [
    {
      name: 'property',
      type: 'str',
    },
  ],
  operands: 1,
  check: true,
};

METADATA[Op.GetBlock] = {
  name: 'GetBlock',
github glimmerjs / glimmer-vm / packages / @glimmer / runtime / lib / compiled / opcodes / expressions.ts View on Github external
let name = vm[CONSTANTS].getString(_name);
  let locals = vm.scope().getPartialMap()!;

  let ref = locals[name];
  if (ref === undefined) {
    ref = vm.getSelf().get(name);
  }

  vm.stack.push(ref);
});

APPEND_OPCODES.add(Op.RootScope, (vm, { op1: symbols }) => {
  vm.pushRootScope(symbols);
});

APPEND_OPCODES.add(Op.GetProperty, (vm, { op1: _key }) => {
  let key = vm[CONSTANTS].getString(_key);
  let expr = check(vm.stack.pop(), CheckPathReference);
  vm.stack.push(expr.get(key));
});

APPEND_OPCODES.add(Op.GetBlock, (vm, { op1: _block }) => {
  let { stack } = vm;
  let block = vm.scope().getBlock(_block);

  stack.push(block);
});

APPEND_OPCODES.add(Op.JitSpreadBlock, vm => {
  let { stack } = vm;
  let block = stack.pop();