]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(compiler-core): skip empty expressions when validating expressions in browser...
authorEvan You <yyx990803@gmail.com>
Mon, 15 Jun 2020 14:59:03 +0000 (10:59 -0400)
committerEvan You <yyx990803@gmail.com>
Mon, 15 Jun 2020 14:59:03 +0000 (10:59 -0400)
packages/compiler-core/src/validateExpression.ts

index 64f171fca7f933277e973c9d04729610b31d519d..3ba985727186697d0b6dc5bcc984c7440e6d60aa 100644 (file)
@@ -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