提交 3352b51e 编写于 作者: Q qiang

fix: 模板绑定空对象编译到微信小程序报错的问题

上级 f370f896
...@@ -183,7 +183,7 @@ const tags = require('@dcloudio/uni-cli-shared/lib/tags') ...@@ -183,7 +183,7 @@ const tags = require('@dcloudio/uni-cli-shared/lib/tags')
const { const {
isBuiltInComponent isBuiltInComponent
} = require('@dcloudio/uni-cli-shared/lib/pages') } = require('@dcloudio/uni-cli-shared/lib/pages')
const { const {
getTagName getTagName
...@@ -223,7 +223,7 @@ function makeMap (str, expectsLowerCase) { ...@@ -223,7 +223,7 @@ function makeMap (str, expectsLowerCase) {
* @param {*} node * @param {*} node
*/ */
function isSimpleObjectExpression (node) { function isSimpleObjectExpression (node) {
return t.isObjectExpression(node) && !node.properties.find(({ return t.isObjectExpression(node) && node.properties.length && !node.properties.find(({
key, key,
value value
}) => !t.isIdentifier(key) || !(t.isIdentifier(value) || t.isStringLiteral(value) || t.isBooleanLiteral(value) || }) => !t.isIdentifier(key) || !(t.isIdentifier(value) || t.isStringLiteral(value) || t.isBooleanLiteral(value) ||
...@@ -261,4 +261,4 @@ module.exports = { ...@@ -261,4 +261,4 @@ module.exports = {
processMemberExpression, processMemberExpression,
getForIndexIdentifier, getForIndexIdentifier,
isSimpleObjectExpression isSimpleObjectExpression
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册