镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

[Transforms] ES6 module exports in namespaces are emitted #7874

Description

Expected:

//// [es5ModuleInternalNamedImports.ts]

export module M {
    // variable
    export var M_V = 0;
    ....

    // Reexports
    export {M_V as v};
    ....
}


//// [es5ModuleInternalNamedImports.js]
define(["require", "exports"], function (require, exports) {
    "use strict";
    var M;
    (function (M) {
        // variable
        M.M_V = 0;
        ....
        // Reexports
    })(M = exports.M || (exports.M = {}));
});

Actual:

//// [es5ModuleInternalNamedImports.ts]

export module M {
    // variable
    export var M_V = 0;
   ....
    // Reexports
    export {M_V as v};
}


//// [es5ModuleInternalNamedImports.js]
define(["require", "exports"], function (require, exports) {
    "use strict";
    var M;
    (function (M) {
        // variable
        M.M_V = 0;
        // Reexports
        export { M_V as v } from ;
    })(M = exports.M || (exports.M = {}));
});

Failed tests:

  • tests\cases\compiler\es5ModuleInternalNamedImports.ts
  • tests/cases/compiler/exportDeclarationInInternalModule.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptDomain: API: TransformsRelates to the public transform APIFixedA PR has been merged for this issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions