TypeScript/tests/cases/conformance
Nathan Shively-Sanders 4d84bde9b3
Only bind module.exports if no local definition exists (#25869)
* Only bind module.exports if no local definition exists

Note that this uses `lookupSymbolForNameWorker`, which is really a
best-effort check since it only knows about symbols that it has already
encountered.

As a side-effect, even when `module` is bound as part of a
`module.exports` reference, it only declares it once instead of one
declaration per reference.

* Only type module.exports inside module files

It is an error inside script files, but the binder sometimes creates a
ModuleExports symbol because we doesn't know whether we have a commonjs
module until after binding is done.

* Only bind module.exports in a commonjs module

Note that this, too, is a best-effort check since evidence of
commonjs-ness may be found after a *reference* to module.exports. (A
reference to module.exports alone is not enough evidence that a file is
commonjs. It has to have an assignment to it.)
2018-07-30 12:27:59 -07:00
..
ambient
async Fix prologue order in async function 2018-06-07 13:34:16 -07:00
classes
constEnums
controlFlow
declarationEmit
decorators
dynamicImport Unpatch vfs resolver and default lib rename 2018-05-03 14:18:50 -07:00
emitter
enums disallow nan and infinity in enum member 2018-05-04 10:28:59 +08:00
es6 Destructuring declaration prefers type annotation type (#25282) 2018-06-28 10:41:38 -07:00
es7 Allow trailing commas after-rest elements in destructuring 2018-06-04 14:58:30 -07:00
es2017
es2018
es2019/importMeta
expressions Add tests 2018-06-02 17:43:37 -07:00
externalModules fix export class declare with name object targeting es5 (#17494) 2018-05-24 18:16:38 +08:00
functions
interfaces
internalModules
jsdoc Support the JSDoc @enum tag (#26021) 2018-07-28 07:53:08 -07:00
jsx Support LibraryManagedAttributes<TComponent, TAttributes> JSX namespace type (#24422) 2018-06-29 18:45:29 -07:00
moduleResolution Don't recommend to install '@types/foo' if that already exists (#24815) 2018-06-21 10:19:14 -07:00
parser Unpatch vfs resolver and default lib rename 2018-05-03 14:18:50 -07:00
references
salsa Only bind module.exports if no local definition exists (#25869) 2018-07-30 12:27:59 -07:00
scanner
statements add grammar check for labeled declaration (#25317) 2018-07-18 15:37:27 -06:00
Symbols
types Add regression test 2018-07-25 12:42:47 -07:00
typings
fixSignatureCaching.ts