message: fix: improve error detector v-for identifier check
  close
diff: @@ -15,9 +15,6 @@ const unaryOperatorsRE = new RegExp('\\b' + (
  'delete,typeof,void'
  ).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)')
  -// check valid identifier for v-for
  -const identRE = /[A-Za-z_$][\w$]*/
  -
  // strip strings in expressions
  const stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g
  @@ -75,11 +72,20 @@ function checkFor (node: ASTElement, text: string, errors: Array<string>) {
  checkIdentifier(node.iterator2, 'v-for iterator', text, errors)
  }
  -function checkIdentifier (ident: ?string, type: string, text: string, errors: Array<string>) {
  - if (typeof ident === 'string' && !identRE.test(ident)) {
  +function checkIdentifier (
  + ident: ?string,
  + type: string,
  + text: string,
  + errors: Array<string>
  +) {
  + if (typeof ident === 'string') {
  + try {
  + new Function(`var ${ident}`)
  + } catch (e) {
  errors.push(`invalid ${type} "${ident}" in expression: ${text.trim()}`)
  }
  }
  +}
  function checkExpression (exp: string, text: string, errors: Array<string>) {
  try {
  