{"size": 945, "ext": "js", "max_stars_repo_path": "src/ast/nodes/TaggedTemplateExpression.js", "max_stars_repo_name": "connectthefuture/rollup", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/ast/nodes/TaggedTemplateExpression.js", "max_issues_repo_name": "connectthefuture/rollup", "max_issues_repo_issues_event_min_datetime": "2022-03-27T05:57:02.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-27T05:57:02.000Z", "max_forks_repo_path": "src/ast/nodes/TaggedTemplateExpression.js", "max_forks_repo_name": "connectthefuture/rollup", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 28.6363636364, "max_line_length": 119, "alphanum_fraction": 0.6571428571}
import Node from '../Node.js';

export default class TaggedTemplateExpression extends Node {
	bind () {
		if ( this.tag.type === 'Identifier' ) {
			const variable = this.scope.findVariable( this.tag.name );

			if ( variable.isNamespace ) {
				this.module.error( {
					code: 'CANNOT_CALL_NAMESPACE',
					message: `Cannot call a namespace ('${this.tag.name}')`
				}, this.start );
			}

			if ( this.tag.name === 'eval' && variable.isGlobal ) {
				this.module.warn( {
					code: 'EVAL',
					message: `Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification`,
					url: 'https://github.com/rollup/rollup/wiki/Troubleshooting#avoiding-eval'
				}, this.start );
			}
		}

		super.bind();
		this.tag.bindCall( { withNew: false } );
	}

	hasEffects ( options ) {
		return super.hasEffects( options )
			|| this.tag.hasEffectsWhenCalled( options.getHasEffectsWhenCalledOptions( this.tag ) );
	}
}
