Add Variable to HasExports (#24871)

JS containers are variables, but may have exports just like classes and
modules.
This commit is contained in:
Nathan Shively-Sanders 2018-06-11 14:45:27 -07:00 committed by GitHub
parent d8f6f30d01
commit 923a8aab0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 64 additions and 3 deletions

View file

@ -3467,7 +3467,7 @@ namespace ts {
ExportHasLocal = Function | Class | Enum | ValueModule,
HasExports = Class | Enum | Module,
HasExports = Class | Enum | Module | Variable,
HasMembers = Class | Interface | TypeLiteral | ObjectLiteral,
BlockScoped = BlockScopedVariable | Class | Enum,

View file

@ -2071,7 +2071,7 @@ declare namespace ts {
AliasExcludes = 2097152,
ModuleMember = 2623475,
ExportHasLocal = 944,
HasExports = 1952,
HasExports = 1955,
HasMembers = 6240,
BlockScoped = 418,
PropertyOrAccessor = 98308,

View file

@ -2071,7 +2071,7 @@ declare namespace ts {
AliasExcludes = 2097152,
ModuleMember = 2623475,
ExportHasLocal = 944,
HasExports = 1952,
HasExports = 1955,
HasMembers = 6240,
BlockScoped = 418,
PropertyOrAccessor = 98308,

View file

@ -0,0 +1,21 @@
=== tests/cases/conformance/salsa/bug24754.js ===
// #24754
const webpack = function (){
>webpack : Symbol(webpack, Decl(bug24754.js, 1, 5))
}
exports = module.exports = webpack;
>exports : Symbol("tests/cases/conformance/salsa/bug24754", Decl(bug24754.js, 0, 0))
>module : Symbol(export=, Decl(bug24754.js, 3, 9))
>exports : Symbol(export=, Decl(bug24754.js, 3, 9))
>webpack : Symbol(webpack, Decl(bug24754.js, 1, 5))
exports.version = 1001;
>exports.version : Symbol(version, Decl(bug24754.js, 3, 35))
>exports : Symbol(version, Decl(bug24754.js, 3, 35))
>version : Symbol(version, Decl(bug24754.js, 3, 35))
webpack.WebpackOptionsDefaulter = 1111;
>webpack.WebpackOptionsDefaulter : Symbol(webpack.WebpackOptionsDefaulter, Decl(bug24754.js, 4, 23))
>webpack : Symbol(webpack, Decl(bug24754.js, 1, 5))
>WebpackOptionsDefaulter : Symbol(webpack.WebpackOptionsDefaulter, Decl(bug24754.js, 4, 23))

View file

@ -0,0 +1,29 @@
=== tests/cases/conformance/salsa/bug24754.js ===
// #24754
const webpack = function (){
>webpack : { (): void; WebpackOptionsDefaulter: number; }
>function (){} : { (): void; WebpackOptionsDefaulter: number; }
}
exports = module.exports = webpack;
>exports = module.exports = webpack : { (): void; WebpackOptionsDefaulter: number; }
>exports : typeof import("tests/cases/conformance/salsa/bug24754")
>module.exports = webpack : { (): void; WebpackOptionsDefaulter: number; }
>module.exports : any
>module : any
>exports : any
>webpack : { (): void; WebpackOptionsDefaulter: number; }
exports.version = 1001;
>exports.version = 1001 : 1001
>exports.version : number
>exports : typeof import("tests/cases/conformance/salsa/bug24754")
>version : number
>1001 : 1001
webpack.WebpackOptionsDefaulter = 1111;
>webpack.WebpackOptionsDefaulter = 1111 : 1111
>webpack.WebpackOptionsDefaulter : number
>webpack : { (): void; WebpackOptionsDefaulter: number; }
>WebpackOptionsDefaulter : number
>1111 : 1111

View file

@ -0,0 +1,11 @@
// @checkJs: true
// @allowJS: true
// @noEmit: true
// @Filename: bug24754.js
// #24754
const webpack = function (){
}
exports = module.exports = webpack;
exports.version = 1001;
webpack.WebpackOptionsDefaulter = 1111;