File tree 3 files changed +27
-1
lines changed
test/runtime/samples/dev-warning-helper
3 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,8 @@ export default class Generator {
156
156
let scope = annotateWithScopes ( expression ) ;
157
157
const dependencies = [ ] ;
158
158
159
+ const generator = this ; // can't use arrow functions, because of this.skip()
160
+
159
161
walk ( expression , {
160
162
enter ( node , parent ) {
161
163
if ( node . _scope ) {
@@ -165,7 +167,7 @@ export default class Generator {
165
167
166
168
if ( isReference ( node , parent ) ) {
167
169
const { name } = flattenReference ( node ) ;
168
- if ( scope . has ( name ) ) return ;
170
+ if ( scope . has ( name ) || generator . helpers . has ( name ) ) return ;
169
171
170
172
if ( contextDependencies . has ( name ) ) {
171
173
dependencies . push ( ...contextDependencies . get ( name ) ) ;
Original file line number Diff line number Diff line change
1
+ export default {
2
+ solo : true ,
3
+
4
+ dev : true ,
5
+
6
+ data : {
7
+ bar : 1
8
+ } ,
9
+
10
+ html : '2' ,
11
+
12
+ warnings : [ ]
13
+ } ;
Original file line number Diff line number Diff line change
1
+ {{foo(bar)}}
2
+
3
+ < script >
4
+ export default {
5
+ helpers : {
6
+ foo ( bar ) {
7
+ return bar * 2 ;
8
+ }
9
+ }
10
+ } ;
11
+ </ script >
You can’t perform that action at this time.
0 commit comments