From afb231ec5ce5ac77ff6260bea4d866ec2d5bbd85 Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 15 Jun 2020 10:59:03 -0400 Subject: [PATCH] fix(compiler-core): skip empty expressions when validating expressions in browser mode --- packages/compiler-core/src/validateExpression.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/compiler-core/src/validateExpression.ts b/packages/compiler-core/src/validateExpression.ts index 64f171fc..3ba98572 100644 --- a/packages/compiler-core/src/validateExpression.ts +++ b/packages/compiler-core/src/validateExpression.ts @@ -32,6 +32,13 @@ export function validateBrowserExpression( asRawStatements = false ) { const exp = node.content + + // empty expressions are validated per-directive since some directives + // do allow empty expressions. + if (!exp.trim()) { + return + } + try { new Function( asRawStatements