d1e2242ee4
* Allow to access `exports` from inside a commonjs module * Don't contextually type `this` in `exports.f = function() { ... }` * Update test
18 lines
308 B
TypeScript
18 lines
308 B
TypeScript
// @module: commonjs
|
|
// @allowJs: true
|
|
// @checkJs: true
|
|
// @noEmit: true
|
|
|
|
// @Filename: /a.js
|
|
exports.x = 0;
|
|
exports.x;
|
|
|
|
// Works nested
|
|
{
|
|
// 'exports' does not provide a contextual type to a function-class
|
|
exports.Cls = function() {
|
|
this.x = 0;
|
|
}
|
|
}
|
|
|
|
const instance = new exports.Cls();
|