Skip to content

Commit 0b4770e

Browse files
committed
fix: callback in catch compileWxml
1 parent a3858c2 commit 0b4770e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/template-compiler/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ module.exports = function (html) {
4040
: compiler.compile
4141

4242
var compiled = compile(html, compilerOptions)
43+
var code
4344

4445
// for mp => *.wxml
4546
compileWxml.call(this, compiled, html)
@@ -51,7 +52,6 @@ module.exports = function (html) {
5152
})
5253
}
5354

54-
var code
5555
if (compiled.errors && compiled.errors.length) {
5656
this.emitError(
5757
`\n Error compiling template:\n${pad(html)}\n` +
@@ -94,6 +94,9 @@ module.exports = function (html) {
9494

9595
this.callback(null, code)
9696
})
97+
.catch(() => {
98+
this.callback(null, code)
99+
})
97100
}
98101

99102
function toFunction (code) {

0 commit comments

Comments
 (0)