Bug in helper function that is emitted by the compiler for module re-exports #10476
Labels
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
Suggestion
An idea for TypeScript
TypeScript Version: 1.8.10
Code
An AMD module with re-exports:
Generates the following code:
Problem:
The emitted helper '__export' function will fail if the exports object has an empty prototype (due to custom module loading system) and thus does not inherit the 'hasOwnProperty' method. It will also not handle correctly exported readonly properties (created by custom decorators).
Workaround:
As a workaround, i currently override the emitted function in my TypeScript code like so:
Please fix the emitted '__exports' function to code similar to the above workaround (at least for ES5/ES6 targets).
The text was updated successfully, but these errors were encountered: