How to use the @glimmer/util.deprecate function in @glimmer/util

To help you get started, we’ve selected a few @glimmer/util 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 / syntax / lib / traversal / traverse.ts View on Github external
function getNodeHandler(
  visitor: NodeVisitor,
  nodeType: N['type']
): NodeTraversal | NodeTraversal | undefined {
  if (nodeType === 'Template' || nodeType === 'Block') {
    if (visitor.Program) {
      if (DEVMODE) {
        deprecate(`TODO`);
      }

      return visitor.Program as any;
    }
  }

  let handler = visitor[nodeType];
  if (handler !== undefined) {
    return (handler as unknown) as NodeTraversal;
  }
  return visitor.All;
}
github glimmerjs / glimmer-vm / packages / @glimmer / syntax / lib / builders.ts View on Github external
path: BuilderHead,
  params: Option,
  hash: Option,
  _defaultBlock: AST.PossiblyDeprecatedBlock,
  _elseBlock?: Option,
  loc?: AST.SourceLocation,
  openStrip?: AST.StripFlags,
  inverseStrip?: AST.StripFlags,
  closeStrip?: AST.StripFlags
): AST.BlockStatement {
  let defaultBlock: AST.Block;
  let elseBlock: Option | undefined;

  if (_defaultBlock.type === 'Template') {
    if (DEVMODE) {
      deprecate(`b.program is deprecated. Use b.blockItself instead.`);
    }

    defaultBlock = (assign({}, _defaultBlock, { type: 'Block' }) as unknown) as AST.Block;
  } else {
    defaultBlock = _defaultBlock;
  }

  if (_elseBlock !== undefined && _elseBlock !== null && _elseBlock.type === 'Template') {
    if (DEVMODE) {
      deprecate(`b.program is deprecated. Use b.blockItself instead.`);
    }

    elseBlock = (assign({}, _elseBlock, { type: 'Block' }) as unknown) as AST.Block;
  } else {
    elseBlock = _elseBlock;
  }