You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/src/compile/nodes/Action.ts

25 lines
628 B

import Node from './shared/Node';
import Expression from './shared/Expression';
import Component from '../Component';
export default class Action extends Node {
type: 'Action';
name: string;
expression: Expression;
usesContext: boolean;
constructor(component: Component, parent, scope, info) {
super(component, parent, scope, info);
component.warn_if_undefined(info, scope);
this.name = info.name;
component.qualify(info.name);
this.expression = info.expression
? new Expression(component, this, scope, info.expression)
: null;
this.usesContext = this.expression && this.expression.usesContext;
}
}