mirror of https://github.com/sveltejs/svelte
parent
5c2e945db2
commit
eaed487a21
@ -1,14 +1,19 @@
|
||||
import Node from './shared/Node';
|
||||
import Block from '../render-dom/Block';
|
||||
import mapChildren from './shared/mapChildren';
|
||||
import TemplateScope from './shared/TemplateScope';
|
||||
|
||||
export default class CatchBlock extends Node {
|
||||
block: Block;
|
||||
scope: TemplateScope;
|
||||
children: Node[];
|
||||
|
||||
constructor(component, parent, scope, info) {
|
||||
super(component, parent, scope, info);
|
||||
this.children = mapChildren(component, parent, scope, info.children);
|
||||
|
||||
this.scope = scope.child();
|
||||
this.scope.add(parent.error, parent.expression.dependencies);
|
||||
this.children = mapChildren(component, parent, this.scope, info.children);
|
||||
|
||||
this.warnIfEmptyBlock();
|
||||
}
|
||||
|
@ -1,14 +1,19 @@
|
||||
import Node from './shared/Node';
|
||||
import Block from '../render-dom/Block';
|
||||
import mapChildren from './shared/mapChildren';
|
||||
import TemplateScope from './shared/TemplateScope';
|
||||
|
||||
export default class ThenBlock extends Node {
|
||||
block: Block;
|
||||
scope: TemplateScope;
|
||||
children: Node[];
|
||||
|
||||
constructor(component, parent, scope, info) {
|
||||
super(component, parent, scope, info);
|
||||
this.children = mapChildren(component, parent, scope, info.children);
|
||||
|
||||
this.scope = scope.child();
|
||||
this.scope.add(parent.value, parent.expression.dependencies);
|
||||
this.children = mapChildren(component, parent, this.scope, info.children);
|
||||
|
||||
this.warnIfEmptyBlock();
|
||||
}
|
||||
|
Loading…
Reference in new issue