diff --git a/src/generators/Generator.js b/src/generators/Generator.js index e16d43da04..39569cc1da 100644 --- a/src/generators/Generator.js +++ b/src/generators/Generator.js @@ -156,6 +156,8 @@ export default class Generator { let scope = annotateWithScopes( expression ); const dependencies = []; + const generator = this; // can't use arrow functions, because of this.skip() + walk( expression, { enter ( node, parent ) { if ( node._scope ) { @@ -165,7 +167,7 @@ export default class Generator { if ( isReference( node, parent ) ) { const { name } = flattenReference( node ); - if ( scope.has( name ) ) return; + if ( scope.has( name ) || generator.helpers.has( name ) ) return; if ( contextDependencies.has( name ) ) { dependencies.push( ...contextDependencies.get( name ) ); diff --git a/src/shared/dom.js b/src/shared/dom.js index ba3dbc139c..6280783cb6 100644 --- a/src/shared/dom.js +++ b/src/shared/dom.js @@ -39,15 +39,15 @@ export function createComment () { } export function addEventListener ( node, event, handler ) { - node.addEventListener ( event, handler, false ); + node.addEventListener( event, handler, false ); } export function removeEventListener ( node, event, handler ) { - node.removeEventListener ( event, handler, false ); + node.removeEventListener( event, handler, false ); } export function setAttribute ( node, attribute, value ) { - node.setAttribute ( attribute, value ); + node.setAttribute( attribute, value ); } export function setXlinkAttribute ( node, attribute, value ) { diff --git a/test/runtime/samples/dev-warning-helper/_config.js b/test/runtime/samples/dev-warning-helper/_config.js new file mode 100644 index 0000000000..4ad6222113 --- /dev/null +++ b/test/runtime/samples/dev-warning-helper/_config.js @@ -0,0 +1,11 @@ +export default { + dev: true, + + data: { + bar: 1 + }, + + html: '2', + + warnings: [] +}; diff --git a/test/runtime/samples/dev-warning-helper/main.html b/test/runtime/samples/dev-warning-helper/main.html new file mode 100644 index 0000000000..f86e8fb09c --- /dev/null +++ b/test/runtime/samples/dev-warning-helper/main.html @@ -0,0 +1,11 @@ +{{foo(bar)}} + + \ No newline at end of file