Skip to content

Commit 1fb227c

Browse files
committed
fix watcher path check
1 parent cb663db commit 1fb227c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/core/observer/watcher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default class Watcher {
6666
if (!this.getter) {
6767
this.getter = function () {}
6868
process.env.NODE_ENV !== 'production' && warn(
69-
'Failed watching path: ' + expOrFn +
69+
`Failed watching path: "${expOrFn}" ` +
7070
'Watcher only accepts simple dot-delimited paths. ' +
7171
'For full control, use a function instead.',
7272
vm

src/core/util/lang.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function def (obj: Object, key: string, val: any, enumerable?: boolean) {
2323
/**
2424
* Parse simple path.
2525
*/
26-
const bailRE = /[^\w\.]/
26+
const bailRE = /[^\w\.\$]/
2727
export function parsePath (path: string): any {
2828
if (bailRE.test(path)) {
2929
return

0 commit comments

Comments
 (0)