|
|
|
@ -7,76 +7,71 @@ import { unpack_destructuring } from './shared/Context.js';
|
|
|
|
|
|
|
|
|
|
|
|
/** @extends Node */
|
|
|
|
/** @extends Node */
|
|
|
|
export default class AwaitBlock extends Node {
|
|
|
|
export default class AwaitBlock extends Node {
|
|
|
|
|
|
|
|
/** @type {'AwaitBlock'} */
|
|
|
|
/** @type {'AwaitBlock'} */
|
|
|
|
type;
|
|
|
|
type;
|
|
|
|
|
|
|
|
|
|
|
|
/** @type {import('./shared/Expression.js').default} */
|
|
|
|
/** @type {import('./shared/Expression.js').default} */
|
|
|
|
expression;
|
|
|
|
expression;
|
|
|
|
|
|
|
|
|
|
|
|
/** @type {import('./shared/Context.js').Context[]} */
|
|
|
|
/** @type {import('./shared/Context.js').Context[]} */
|
|
|
|
then_contexts;
|
|
|
|
then_contexts;
|
|
|
|
|
|
|
|
|
|
|
|
/** @type {import('./shared/Context.js').Context[]} */
|
|
|
|
/** @type {import('./shared/Context.js').Context[]} */
|
|
|
|
catch_contexts;
|
|
|
|
catch_contexts;
|
|
|
|
|
|
|
|
|
|
|
|
/** @type {ESTreeNode | null} */
|
|
|
|
/** @type {ESTreeNode | null} */
|
|
|
|
then_node;
|
|
|
|
then_node;
|
|
|
|
|
|
|
|
|
|
|
|
/** @type {ESTreeNode | null} */
|
|
|
|
/** @type {ESTreeNode | null} */
|
|
|
|
catch_node;
|
|
|
|
catch_node;
|
|
|
|
|
|
|
|
|
|
|
|
/** @type {import('./PendingBlock.js').default} */
|
|
|
|
/** @type {import('./PendingBlock.js').default} */
|
|
|
|
pending;
|
|
|
|
pending;
|
|
|
|
|
|
|
|
|
|
|
|
/** @type {import('./ThenBlock.js').default} */
|
|
|
|
/** @type {import('./ThenBlock.js').default} */
|
|
|
|
then;
|
|
|
|
then;
|
|
|
|
|
|
|
|
|
|
|
|
/** @type {import('./CatchBlock.js').default} */
|
|
|
|
/** @type {import('./CatchBlock.js').default} */
|
|
|
|
catch;
|
|
|
|
catch;
|
|
|
|
|
|
|
|
|
|
|
|
/** @type {Map<string, ESTreeNode>} */
|
|
|
|
/** @type {Map<string, ESTreeNode>} */
|
|
|
|
context_rest_properties = new Map();
|
|
|
|
context_rest_properties = new Map();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @param {import('../Component.js').default} component *
|
|
|
|
* @param {import('../Component.js').default} component *
|
|
|
|
* @param {import('./shared/Node.js').default} parent *
|
|
|
|
* @param {import('./shared/Node.js').default} parent *
|
|
|
|
* @param {import('./shared/TemplateScope.js').default} scope *
|
|
|
|
* @param {import('./shared/TemplateScope.js').default} scope *
|
|
|
|
* @param {import('../../interfaces.js').TemplateNode} info undefined
|
|
|
|
* @param {import('../../interfaces.js').TemplateNode} info undefined
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
constructor(component, parent, scope, info) {
|
|
|
|
constructor(component, parent, scope, info) {
|
|
|
|
super(component, parent, scope, info);
|
|
|
|
super(component, parent, scope, info);
|
|
|
|
this.cannot_use_innerhtml();
|
|
|
|
this.cannot_use_innerhtml();
|
|
|
|
this.not_static_content();
|
|
|
|
this.not_static_content();
|
|
|
|
this.expression = new Expression(component, this, scope, info.expression);
|
|
|
|
this.expression = new Expression(component, this, scope, info.expression);
|
|
|
|
this.then_node = info.value;
|
|
|
|
this.then_node = info.value;
|
|
|
|
this.catch_node = info.error;
|
|
|
|
this.catch_node = info.error;
|
|
|
|
if (this.then_node) {
|
|
|
|
if (this.then_node) {
|
|
|
|
this.then_contexts = [];
|
|
|
|
this.then_contexts = [];
|
|
|
|
unpack_destructuring({
|
|
|
|
unpack_destructuring({
|
|
|
|
contexts: this.then_contexts,
|
|
|
|
contexts: this.then_contexts,
|
|
|
|
node: info.value,
|
|
|
|
node: info.value,
|
|
|
|
scope,
|
|
|
|
scope,
|
|
|
|
component,
|
|
|
|
component,
|
|
|
|
context_rest_properties: this.context_rest_properties
|
|
|
|
context_rest_properties: this.context_rest_properties
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (this.catch_node) {
|
|
|
|
if (this.catch_node) {
|
|
|
|
this.catch_contexts = [];
|
|
|
|
this.catch_contexts = [];
|
|
|
|
unpack_destructuring({
|
|
|
|
unpack_destructuring({
|
|
|
|
contexts: this.catch_contexts,
|
|
|
|
contexts: this.catch_contexts,
|
|
|
|
node: info.error,
|
|
|
|
node: info.error,
|
|
|
|
scope,
|
|
|
|
scope,
|
|
|
|
component,
|
|
|
|
component,
|
|
|
|
context_rest_properties: this.context_rest_properties
|
|
|
|
context_rest_properties: this.context_rest_properties
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.pending = new PendingBlock(component, this, scope, info.pending);
|
|
|
|
this.pending = new PendingBlock(component, this, scope, info.pending);
|
|
|
|
this.then = new ThenBlock(component, this, scope, info.then);
|
|
|
|
this.then = new ThenBlock(component, this, scope, info.then);
|
|
|
|
this.catch = new CatchBlock(component, this, scope, info.catch);
|
|
|
|
this.catch = new CatchBlock(component, this, scope, info.catch);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|