Browse Source

Add module id when warning about top level this

Hard to fix the problem when not knowing which module actually has it.
legacy-quote-reserved-properties
Daniel K 8 years ago
committed by GitHub
parent
commit
ed35cef98f
  1. 2
      src/ast/nodes/ThisExpression.js

2
src/ast/nodes/ThisExpression.js

@ -7,7 +7,7 @@ export default class ThisExpression extends Node {
if ( lexicalBoundary.isModuleScope ) {
this.alias = this.module.bundle.context;
if ( this.alias === 'undefined' ) {
this.module.bundle.onwarn( 'The `this` keyword is equivalent to `undefined` at the top level of an ES module, and has been rewritten' );
this.module.bundle.onwarn( `The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten (in ${this.module.id})` );
}
}
}

Loading…
Cancel
Save