mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
38 lines
610 B
TypeScript
38 lines
610 B
TypeScript
//// [tests/cases/compiler/blockScopedEnumVariablesUseBeforeDef.ts] ////
|
|
|
|
//// [blockScopedEnumVariablesUseBeforeDef.ts]
|
|
function foo1() {
|
|
return E.A
|
|
enum E { A }
|
|
}
|
|
|
|
function foo2() {
|
|
return E.A
|
|
const enum E { A }
|
|
}
|
|
|
|
const config = {
|
|
a: AfterObject.A,
|
|
};
|
|
|
|
const enum AfterObject {
|
|
A = 2,
|
|
}
|
|
|
|
|
|
//// [blockScopedEnumVariablesUseBeforeDef.js]
|
|
"use strict";
|
|
function foo1() {
|
|
return E.A;
|
|
let E;
|
|
(function (E) {
|
|
E[E["A"] = 0] = "A";
|
|
})(E || (E = {}));
|
|
}
|
|
function foo2() {
|
|
return 0 /* E.A */;
|
|
}
|
|
const config = {
|
|
a: 2 /* AfterObject.A */,
|
|
};
|