Skip to content

Helpers are emitted after imports #2811

@mhegazy

Description

@mhegazy

Helpers are emitted at the top of the file before any imports. This way these helpers can not be imported using external module imports.

import 'reflect-metadata';
@inject
class House {
}
var __metadata = this.__metadata || (typeof Reflect === "object" && Reflect.metadata) || function () { };
require('reflect-metadata');

that also applies to __extends, __decorate, __param as well

See #2249 (comment) for more details

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptNeeds ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions