Determining value of hasCatch on build time

pull/5149/head
Irshad P I 5 years ago
parent 776a7e2eec
commit b9915b23aa

@ -188,7 +188,7 @@ export default class AwaitBlockWrapper extends Wrapper {
ctx: #ctx,
current: null,
token: null,
hasCatch: false,
hasCatch: ${this.catch.node.start !== null ? 'true' : 'false'},
pending: ${this.pending.block.name},
then: ${this.then.block.name},
catch: ${this.catch.block.name},
@ -201,12 +201,6 @@ export default class AwaitBlockWrapper extends Wrapper {
let ${info} = ${info_props};
`);
if (this.catch.node.start !== null) {
block.chunks.init.push(b`
${info}.hasCatch = true;
`);
}
block.chunks.init.push(b`
@handle_promise(${promise} = ${snippet}, ${info});
`);

Loading…
Cancel
Save