Skip to content

Commit

Permalink
Fix js variable regular expression
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipRazek committed Jan 25, 2024
1 parent 7de2ae4 commit 42690d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/language-html/embed/vue-bindings.js
Expand Up @@ -19,8 +19,9 @@ function isVueEventBindingExpression(eventBindingValue) {
// arrow function or anonymous function
const fnExpRE = /^(?:[\w$]+|\([^)]*\))\s*=>|^function\s*\(/;
// simple member expression chain (a, a.b, a['b'], a["b"], a[0], a[b])

const simplePathRE =
/^[$_a-z][\w$]*(?:\.[$_a-z][\w$]*|\['[^']*']|\["[^"]*"]|\[\d+]|\[[$_a-z][\w$]*])*$/i;
/^[^\s;,]+(?:\.[^\s;,]+|\['[^']*']|\["[^"]*"]|\[\d+]|\[[^\s;,]+])*$/i;

// https://github.com/vuejs/vue/blob/v2.5.17/src/compiler/helpers.js#L104
const value = eventBindingValue.trim();
Expand Down

0 comments on commit 42690d8

Please sign in to comment.