-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed as not planned
Labels
Not a DefectThis behavior is one of several equally-correct optionsThis behavior is one of several equally-correct options
Description
π Search Terms
namespace const generated
π Version & Regression Information
ts stable & nightly
β― Playground Link
π» Code
export namespace Foo {
export const foo = {};
export function bar() { return foo; }
}π Actual behavior
export var Foo;
(function (Foo) {
Foo.foo = {};
function bar() { return Foo.foo; }
Foo.bar = bar;
})(Foo || (Foo = {}));const <name> is not generated, and typecript injects property accessors <namespace>.<name>
π Expected behavior
export var Foo;
(function (Foo) {
const foo = {};
Foo.foo = foo;
function bar() { return foo; }
Foo.bar = bar;
})(Foo || (Foo = {}));const <name> is generated, and typescript does not inject property accessors
Additional information about the issue
I'd expect export let/var <name> variables to work this way since they can be modified, but consts should be declared as consts in the codegen.
Metadata
Metadata
Assignees
Labels
Not a DefectThis behavior is one of several equally-correct optionsThis behavior is one of several equally-correct options