Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function fixSVG(parent: Element, div: HTMLElement, html: string, reference: Node): Bounds {
assert(html !== '', 'html cannot be empty');
let source: Node;
// This is important, because decendants of the
APPEND_OPCODES.add(Op.HasBlockParams, vm => {
// FIXME(mmun): should only need to push the symbol table
let block = vm.stack.pop();
let scope = vm.stack.pop();
check(block, CheckOption(CheckOr(CheckHandle, CheckCompilableBlock)));
check(scope, CheckOption(CheckScope));
let table = check(vm.stack.pop(), CheckOption(CheckBlockSymbolTable));
assert(
table === null || (table && typeof table === 'object' && Array.isArray(table.parameters)),
stackAssert('Option', table)
);
let hasBlockParams = table && table.parameters.length;
vm.stack.push(hasBlockParams ? TRUE_REFERENCE : FALSE_REFERENCE);
});
protected async _render(): Promise {
const env = expect(this.env, 'Unexpected missing environment during render');
// Create the template context for the root `main` template, which just
// contains the array of component roots. Any property references in that
// template will be looked up from this object.
let self = (this._self = new UpdatableReference({ roots: this._roots }));
// Create an empty root scope.
let dynamicScope = new DefaultDynamicScope();
let builder = this.builder.getBuilder(env);
let templateIterator = await this.loader.getTemplateIterator(
this,
env,
builder,
dynamicScope,
constructor(
private outletRef: VersionedPathReference,
env: Environment
) {
// The router always dirties the root state.
let tag = (this.tag = outletRef.tag);
if (EMBER_ROUTING_MODEL_ARG) {
let modelRef = new OutletModelReference(outletRef, env);
let map = dict();
map.model = modelRef;
// TODO: the functionailty to create a proper CapturedArgument should be
// exported by glimmer, or that it should provide an overload for `curry`
// that takes `PreparedArguments`
this.args = {
tag,
positional: EMPTY_ARGS.positional,
named: {
tag,
map,
names: ['model'],
references: [modelRef],
length: 1,
has(key: string): boolean {
return key === 'model';
import * as AST from '../types/nodes';
// ensure stays in sync with typing
// ParentNode and ChildKey types are derived from VisitorKeysMap
const visitorKeys = {
Program: tuple('body'),
Template: tuple('body'),
Block: tuple('body'),
MustacheStatement: tuple('path', 'params', 'hash'),
BlockStatement: tuple('path', 'params', 'hash', 'program', 'inverse'),
ElementModifierStatement: tuple('path', 'params', 'hash'),
PartialStatement: tuple('name', 'params', 'hash'),
CommentStatement: tuple(),
MustacheCommentStatement: tuple(),
ElementNode: tuple('attributes', 'modifiers', 'children', 'comments'),
AttrNode: tuple('value'),
TextNode: tuple(),
ConcatStatement: tuple('parts'),
SubExpression: tuple('path', 'params', 'hash'),
PathExpression: tuple(),
StringLiteral: tuple(),
BooleanLiteral: tuple(),
NumberLiteral: tuple(),
NullLiteral: tuple(),
UndefinedLiteral: tuple(),
Hash: tuple('pairs'),
HashPair: tuple('value'),
};
import { tuple } from '@glimmer/util';
import * as AST from '../types/nodes';
// ensure stays in sync with typing
// ParentNode and ChildKey types are derived from VisitorKeysMap
const visitorKeys = {
Program: tuple('body'),
Template: tuple('body'),
Block: tuple('body'),
MustacheStatement: tuple('path', 'params', 'hash'),
BlockStatement: tuple('path', 'params', 'hash', 'program', 'inverse'),
ElementModifierStatement: tuple('path', 'params', 'hash'),
PartialStatement: tuple('name', 'params', 'hash'),
CommentStatement: tuple(),
MustacheCommentStatement: tuple(),
ElementNode: tuple('attributes', 'modifiers', 'children', 'comments'),
AttrNode: tuple('value'),
TextNode: tuple(),
ConcatStatement: tuple('parts'),
SubExpression: tuple('path', 'params', 'hash'),
PathExpression: tuple(),
StringLiteral: tuple(),
BooleanLiteral: tuple(),
NumberLiteral: tuple(),
NullLiteral: tuple(),
import { tuple } from '@glimmer/util';
import * as AST from '../types/nodes';
// ensure stays in sync with typing
// ParentNode and ChildKey types are derived from VisitorKeysMap
const visitorKeys = {
Program: tuple('body'),
Template: tuple('body'),
Block: tuple('body'),
MustacheStatement: tuple('path', 'params', 'hash'),
BlockStatement: tuple('path', 'params', 'hash', 'program', 'inverse'),
ElementModifierStatement: tuple('path', 'params', 'hash'),
PartialStatement: tuple('name', 'params', 'hash'),
CommentStatement: tuple(),
MustacheCommentStatement: tuple(),
ElementNode: tuple('attributes', 'modifiers', 'children', 'comments'),
AttrNode: tuple('value'),
TextNode: tuple(),
ConcatStatement: tuple('parts'),
SubExpression: tuple('path', 'params', 'hash'),
PathExpression: tuple(),
StringLiteral: tuple(),
BooleanLiteral: tuple(),
NumberLiteral: tuple(),
NullLiteral: tuple(),
UndefinedLiteral: tuple(),
import { tuple } from '@glimmer/util';
import * as AST from '../types/nodes';
// ensure stays in sync with typing
// ParentNode and ChildKey types are derived from VisitorKeysMap
const visitorKeys = {
Program: tuple('body'),
Template: tuple('body'),
Block: tuple('body'),
MustacheStatement: tuple('path', 'params', 'hash'),
BlockStatement: tuple('path', 'params', 'hash', 'program', 'inverse'),
ElementModifierStatement: tuple('path', 'params', 'hash'),
PartialStatement: tuple('name', 'params', 'hash'),
CommentStatement: tuple(),
MustacheCommentStatement: tuple(),
ElementNode: tuple('attributes', 'modifiers', 'children', 'comments'),
AttrNode: tuple('value'),
TextNode: tuple(),
ConcatStatement: tuple('parts'),
SubExpression: tuple('path', 'params', 'hash'),
PathExpression: tuple(),
StringLiteral: tuple(),
BooleanLiteral: tuple(),
NumberLiteral: tuple(),
NullLiteral: tuple(),
UndefinedLiteral: tuple(),
Hash: tuple('pairs'),
import { tuple } from '@glimmer/util';
import * as AST from '../types/nodes';
// ensure stays in sync with typing
// ParentNode and ChildKey types are derived from VisitorKeysMap
const visitorKeys = {
Program: tuple('body'),
Template: tuple('body'),
Block: tuple('body'),
MustacheStatement: tuple('path', 'params', 'hash'),
BlockStatement: tuple('path', 'params', 'hash', 'program', 'inverse'),
ElementModifierStatement: tuple('path', 'params', 'hash'),
PartialStatement: tuple('name', 'params', 'hash'),
CommentStatement: tuple(),
MustacheCommentStatement: tuple(),
ElementNode: tuple('attributes', 'modifiers', 'children', 'comments'),
AttrNode: tuple('value'),
TextNode: tuple(),
ConcatStatement: tuple('parts'),
SubExpression: tuple('path', 'params', 'hash'),
PathExpression: tuple(),
import { tuple } from '@glimmer/util';
import * as AST from '../types/nodes';
// ensure stays in sync with typing
// ParentNode and ChildKey types are derived from VisitorKeysMap
const visitorKeys = {
Program: tuple('body'),
Template: tuple('body'),
Block: tuple('body'),
MustacheStatement: tuple('path', 'params', 'hash'),
BlockStatement: tuple('path', 'params', 'hash', 'program', 'inverse'),
ElementModifierStatement: tuple('path', 'params', 'hash'),
PartialStatement: tuple('name', 'params', 'hash'),
CommentStatement: tuple(),
MustacheCommentStatement: tuple(),
ElementNode: tuple('attributes', 'modifiers', 'children', 'comments'),
AttrNode: tuple('value'),
TextNode: tuple(),
ConcatStatement: tuple('parts'),
SubExpression: tuple('path', 'params', 'hash'),
PathExpression: tuple(),
StringLiteral: tuple(),
BooleanLiteral: tuple(),
NumberLiteral: tuple(),
NullLiteral: tuple(),
UndefinedLiteral: tuple(),