diff --git a/src/ast/nodes/ThisExpression.js b/src/ast/nodes/ThisExpression.js index 16aed87..ae35173 100644 --- a/src/ast/nodes/ThisExpression.js +++ b/src/ast/nodes/ThisExpression.js @@ -1,5 +1,6 @@ import Node from '../Node.js'; import getLocation from '../../utils/getLocation.js'; +import relativeId from '../../utils/relativeId.js'; const warning = `The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten. See https://github.com/rollup/rollup/wiki/Troubleshooting#this-is-undefined for more information`; @@ -11,7 +12,7 @@ export default class ThisExpression extends Node { this.alias = this.module.context; if ( this.alias === 'undefined' ) { const { line, column } = getLocation( this.module.code, this.start ); - const detail = `${this.module.id} (${line}:${column + 1})`; // use one-based column number convention + const detail = `${relativeId( this.module.id )} (${line}:${column + 1})`; // use one-based column number convention this.module.bundle.onwarn( `${detail} ${warning}` ); } } diff --git a/test/function/warn-on-top-level-this/_config.js b/test/function/warn-on-top-level-this/_config.js index 9976ec1..99c3f2c 100644 --- a/test/function/warn-on-top-level-this/_config.js +++ b/test/function/warn-on-top-level-this/_config.js @@ -1,7 +1,6 @@ const assert = require( 'assert' ); module.exports = { - solo: true, description: 'warns on top-level this (#770)', warnings: warnings => { assert.deepEqual( warnings, [