Browse Source

fix watcher path check

dev
Evan You 9 years ago
parent
commit
1fb227cb90
  1. 2
      src/core/observer/watcher.js
  2. 2
      src/core/util/lang.js

2
src/core/observer/watcher.js

@ -66,7 +66,7 @@ export default class Watcher {
if (!this.getter) {
this.getter = function () {}
process.env.NODE_ENV !== 'production' && warn(
'Failed watching path: ' + expOrFn +
`Failed watching path: "${expOrFn}" ` +
'Watcher only accepts simple dot-delimited paths. ' +
'For full control, use a function instead.',
vm

2
src/core/util/lang.js

@ -23,7 +23,7 @@ export function def (obj: Object, key: string, val: any, enumerable?: boolean) {
/**
* Parse simple path.
*/
const bailRE = /[^\w\.]/
const bailRE = /[^\w\.\$]/
export function parsePath (path: string): any {
if (bailRE.test(path)) {
return

Loading…
Cancel
Save