修复empty方法已经删除的bug

master
宇天 2018-06-05 01:21:22 +08:00
parent 9f1566dda1
commit b53aa1c4f5
2 changed files with 11 additions and 5 deletions

View File

@ -149,7 +149,7 @@ class Tool {
m = m.replace(begin, '').replace(end, '')
m = m.trim()
if (empty(m) || !/\sin\s/.test(m)) {
if (!m || !/\sin\s/.test(m)) {
return new Error('Wrong each loop')
}
@ -175,7 +175,9 @@ class Tool {
m = m.replace(begin, '').replace(end, '')
m = m.trim()
if (empty(m)) return `\`; tpl += \``
if (!m) {
return `\`; tpl += \``
}
return `\`; if (${m}){ tpl += \``
}
@ -188,7 +190,9 @@ class Tool {
m = m.replace(begin, '').replace(end, '')
m = m.trim()
if (empty(m)) return `\`;} else { tpl += \``
if (!m) {
return `\`;} else { tpl += \``
}
return `\`; } else if (${m}){ tpl += \``
}
@ -201,7 +205,9 @@ class Tool {
m = m.replace(begin, '').replace(end, '')
m = m.trim()
if (!empty(m) || /=/.test(m)) m = 'let ' + m
if (m && /=/.test(m)) {
m = 'let ' + m
}
this.vars += ` ${m};`

View File

@ -1,6 +1,6 @@
{
"name": "smartyx",
"version": "1.0.1",
"version": "1.0.2",
"description": "nodeJS模板引擎理念源自于PHP的smarty模板引擎",
"keywords": [
"fivejs",