-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
I have an enum in an interface that, when used in my TS code in TypeScript 1.3, was output as a constant. This is no longer the case in 1.4 after saving my file. When i build the project, the enum code is properly output as a constant. Using VS 2013 update 4 with TypeScript 1.4 installed.
Enum declaration file (Colors.d.ts):
declare module server {
enum Colors {
Red = 0,
Green = 0,
Blue = 0
}
}
TS Code:
if(box.color === server.Colors.Red) {
...
}
JS Output after save:
if(box.color === server.Colors.Red) {
...
}
JS Output after build (correct, or what i consider to be correct since there is no implementation of the enum):
if(box.color === 0 /* Red */) {
...
}
The same is observed if the enum is declared using the new "const enum" feature.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue