Skip to content

Commit e7a8d5d

Browse files
committed
fix: add error msg for events with params for lite widget
Signed-off-by: lileirjyb <[email protected]>
1 parent 938e69b commit e7a8d5d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/hap-compiler/src/template/validator.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,6 +1807,12 @@ function checkEvent(name, value, output) {
18071807
// 如果表达式形式为XXX(xxxx)
18081808
const paramsMatch = value.match(/(.*)\((.*)\)/)
18091809
if (paramsMatch) {
1810+
if (output.isLite) {
1811+
const err = new Error('轻卡不支持带参数的事件')
1812+
err.isExpressionError = true
1813+
err.expression = value
1814+
throw err
1815+
}
18101816
const funcName = paramsMatch[1]
18111817
let params = paramsMatch[2]
18121818
// 解析','分隔的参数

0 commit comments

Comments
 (0)