Emit the property assignment comments of the object literal

This commit is contained in:
Sheetal Nandi 2014-08-14 05:57:24 -07:00
parent 871507e386
commit d815c14943
5 changed files with 10 additions and 0 deletions

View file

@ -716,9 +716,11 @@ module ts {
}
function emitPropertyAssignment(node: PropertyDeclaration) {
emitLeadingComments(node);
emit(node.name);
write(": ");
emit(node.initializer);
emitTrailingComments(node);
}
function emitPropertyAccess(node: PropertyAccess) {

View file

@ -91,6 +91,7 @@ var i3_i;
i3_i = {
f: function (a) { return "Hello" + a; },
l: this.f,
/** own x*/
x: this.f(10),
nc_x: this.l(this.x),
nc_f: this.f,

View file

@ -14,6 +14,11 @@ var Person = makeClass(
//// [commentsOnObjectLiteral2.js]
var Person = makeClass({
/**
This is just another way to define a constructor.
@constructs
@param {string} name The name of the person.
*/
initialize: function (name) {
this.name = name;
}

View file

@ -7,5 +7,6 @@ var a = {
//// [commentsPropertySignature1.js]
var a = {
/** own x*/
x: 0
};

View file

@ -92,6 +92,7 @@ var b = {
var a = x['foo']();
return a + x.notHere();
},
// BUG 794164
bar: b.foo(1).notHere()
};
var r4 = b.foo(new B());