-
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 issueHigh Priority
Milestone
Description
TypeScript Version: 2.0.3
Code
// A *self-contained* demonstration of the problem follows...
var config = {
["__type"]: "QAQ",
get type() {
return this.__type
},
set type(new_type) {
this.__type = new_type
}
}
Expected behavior:
var config = (_a = {},
_a["__type"] = "QAQ",
Object.defineProperty(_a, "type", {
get: function () {
return this.__type;
},
set: function (new_type) {
this.__type = new_type;
},
enumerable: true,
configurable: true
}),
_a
);
var _a;
Actual behavior:
Uncaught SyntaxError: Unexpected token ,
var config = (_a = {},
_a["__type"] = "QAQ",
Object.defineProperty(_a, "type", {
get: function () {
return this.__type;
},
set: function (new_type) {
this.__type = new_type;
},
enumerable: true,
configurable: true
}),
, // Here, One more comma, then run error
_a
);
var _a;
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueHigh Priority