-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this
Milestone
Description
TypeScript Version: 2.2 to current
Code
TS file:
export class Object {}
tsconfig.json:
{"compilerOptions": {"target": "es5"}}
Expected behavior:
The module should be able to initialize like it did in TypeScript 2.1.
Actual behavior:
Module fails to initialize; TypeError: Object is undefined.
The emitted code is
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Object = (function () {
function Object() {
}
return Object;
}());
exports.Object = Object;
Clearly Object.defineProperty is intended to reference the global Object, but it gets an uninitialized local variable instead.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this