From 0e1293db16fec32b38e76f2dafa51a6b338fbfaf Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Fri, 11 Aug 2017 09:09:14 -0400 Subject: [PATCH] apply scope refactoring to TaggedTemplateExpression --- src/ast/nodes/TaggedTemplateExpression.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/ast/nodes/TaggedTemplateExpression.js b/src/ast/nodes/TaggedTemplateExpression.js index 7cd3a7679ee..b81ffdbc9c7 100644 --- a/src/ast/nodes/TaggedTemplateExpression.js +++ b/src/ast/nodes/TaggedTemplateExpression.js @@ -3,9 +3,9 @@ import isProgramLevel from '../utils/isProgramLevel.js'; import callHasEffects from './shared/callHasEffects.js'; export default class TaggedTemplateExpression extends Node { - bind ( scope ) { + bind () { if ( this.tag.type === 'Identifier' ) { - const declaration = scope.findDeclaration( this.tag.name ); + const declaration = this.scope.findDeclaration( this.tag.name ); if ( declaration.isNamespace ) { this.module.error({ @@ -23,21 +23,20 @@ export default class TaggedTemplateExpression extends Node { } } - super.bind( scope ); + super.bind(); } - hasEffects ( scope ) { - return this.quasi.hasEffects(scope) || callHasEffects( scope, this.tag, false ); + hasEffects () { + return this.quasi.hasEffects() || callHasEffects( this.scope, this.tag, false ); } - initialise ( scope ) { + initialiseNode () { if ( isProgramLevel( this ) ) { this.module.bundle.dependentExpressions.push( this ); } - super.initialise( scope ); } isUsedByBundle () { - return this.hasEffects( this.findScope() ); + return this.hasEffects(); } }