From 849999dedb206ef272ac4e1f71cc2f2c3711dcde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=99=93=E4=B8=9C?= Date: Fri, 21 Jun 2019 18:07:57 +0800 Subject: [PATCH] =?UTF-8?q?fix(cli):=20=E5=BC=95=E5=85=A5json=E5=8C=85?= =?UTF-8?q?=E5=90=ABnull=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8Cclose=20#3505?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/NervJS/taro/issues/3505 --- packages/taro-cli/src/util/astConvert.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/taro-cli/src/util/astConvert.ts b/packages/taro-cli/src/util/astConvert.ts index 8aee0493b42f..12ef0ac07247 100644 --- a/packages/taro-cli/src/util/astConvert.ts +++ b/packages/taro-cli/src/util/astConvert.ts @@ -20,6 +20,9 @@ export function convertObjectToAstExpression (obj: object): t.ObjectProperty[] { if (Array.isArray(value)) { return t.objectProperty(t.stringLiteral(key), t.arrayExpression(convertArrayToAstExpression(value as []))) } + if (value === null) { + return t.objectProperty(t.stringLiteral(key), t.nullLiteral()) + } if (typeof value === 'object') { return t.objectProperty(t.stringLiteral(key), t.objectExpression(convertObjectToAstExpression(value))) }