TypeScript/tests/baselines/reference/augmentedTypesEnum2.js
Cyrus Najmabadi 5a7500ca5e Add a dedicated 'EndOfFile' token to a SourceFile.
This is important for incremental parsing, as it is where we can attach parse errors at the end of
the file to.  Also, it helps with things like emitting comments at the end of the file.
2014-12-02 16:09:41 -08:00

44 lines
796 B
JavaScript

//// [augmentedTypesEnum2.ts]
// enum then interface
enum e1 { One } // error
interface e1 { // error
foo(): void;
}
// interface then enum works
// enum then class
enum e2 { One }; // error
class e2 { // error
foo() {
return 1;
}
}
//enum then enum - covered
//enum then import - covered
//// [augmentedTypesEnum2.js]
// enum then interface
var e1;
(function (e1) {
e1[e1["One"] = 0] = "One";
})(e1 || (e1 = {})); // error
// interface then enum works
// enum then class
var e2;
(function (e2) {
e2[e2["One"] = 0] = "One";
})(e2 || (e2 = {}));
;
var e2 = (function () {
function e2() {
}
e2.prototype.foo = function () {
return 1;
};
return e2;
})();
//enum then enum - covered
//enum then import - covered