TypeScript/tests/cases/conformance/salsa/moduleExportWithExportPropertyAssignment2.ts
Nathan Shively-Sanders a7a01eadba
Allow both module.exports= and module.exports property assignments (#23228)
* Combining symbol and removing error done but messy

* Small fix + add new test baselines

All other tests are unchanged

* Union conflicting assignment types+better names

* Add tests and update baselines

* Check commonjs export= from resolveExternalModuleSymbol
2018-04-06 13:04:39 -07:00

17 lines
441 B
TypeScript

// @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: requires.d.ts
declare var module: { exports: any };
declare function require(name: string): any;
// @Filename: mod1.js
/// <reference path='./requires.d.ts' />
module.exports = 1
module.exports.f = function () { }
// @Filename: a.js
/// <reference path='./requires.d.ts' />
var mod1 = require('./mod1')
mod1.toFixed(12)
mod1.f() // error, 'f' is not a property on 'number'