* Refactor declaration emitter into declaration transformer * Slight cleanup from code review feedback * Incorporate fix for new test * Swaths of PR feedback * Merge public methods * Per-file output * Preserve input import ordering more often * Unify jsdoc comment start detection under more lenient rule * Move to per-file transformations to reduce the memory that msut be retained * Fix typo
31 lines
1,017 B
TypeScript
31 lines
1,017 B
TypeScript
//// [constEnum2.ts]
|
|
// An enum declaration that specifies a const modifier is a constant enum declaration.
|
|
// In a constant enum declaration, all members must have constant values and
|
|
// it is an error for a member declaration to specify an expression that isn't classified as a constant enum expression.
|
|
|
|
// Error : not a constant enum expression
|
|
|
|
const CONST = 9000 % 2;
|
|
const enum D {
|
|
d = 10,
|
|
e = 199 * Math.floor(Math.random() * 1000),
|
|
f = d - (100 * Math.floor(Math.random() % 8))
|
|
g = CONST,
|
|
}
|
|
|
|
//// [constEnum2.js]
|
|
// An enum declaration that specifies a const modifier is a constant enum declaration.
|
|
// In a constant enum declaration, all members must have constant values and
|
|
// it is an error for a member declaration to specify an expression that isn't classified as a constant enum expression.
|
|
// Error : not a constant enum expression
|
|
var CONST = 9000 % 2;
|
|
|
|
|
|
//// [constEnum2.d.ts]
|
|
declare const CONST: number;
|
|
declare const enum D {
|
|
d = 10,
|
|
e,
|
|
f,
|
|
g
|
|
}
|