mirror of https://github.com/lukechilds/rollup.git
Rich Harris
9 years ago
committed by
GitHub
5 changed files with 21 additions and 3 deletions
@ -1,3 +1,6 @@ |
|||||
module.exports = { |
module.exports = { |
||||
description: 'top-level `this` expression is rewritten as `undefined`' |
description: 'top-level `this` expression is rewritten as `undefined`', |
||||
|
options: { |
||||
|
onwarn: () => {} |
||||
|
} |
||||
}; |
}; |
||||
|
@ -0,0 +1,13 @@ |
|||||
|
const assert = require( 'assert' ); |
||||
|
|
||||
|
module.exports = { |
||||
|
description: 'warns on top-level this (#770)', |
||||
|
warnings: warnings => { |
||||
|
assert.deepEqual( warnings, [ |
||||
|
'The `this` keyword is equivalent to `undefined` at the top level of an ES module, and has been rewritten' |
||||
|
]); |
||||
|
}, |
||||
|
runtimeError: err => { |
||||
|
assert.equal( err.message, `Cannot set property 'foo' of undefined` ); |
||||
|
} |
||||
|
}; |
@ -0,0 +1 @@ |
|||||
|
this.foo = 'bar'; |
Loading…
Reference in new issue