2

Closed

An error when emitting comments to output

description

the following code emits comments in wrong place:




/**
  • Some class comment...
    */
    export class MyClass {
    /**
    • Some method comment...
      */
      public static doSomething(){
      }
      }
output:




/**
  • Some class comment...
    */
    var MyClass = (function () {
    function MyClass() { }
    MyClass.doSomething = /**
    *   Some method comment...
    */
     function doSomething() {
     }
     return MyClass;
    })();
This is a valid JavaScript code, but... should the "Some method comment..." be there?
Closed Feb 20, 2013 at 1:57 AM by RyanCavanaugh
Closing as duplicate of http://typescript.codeplex.com/workitem/639 -- all the comment preservation issues are being treated as one bug due to the parser rewrite.

comments

RyanCavanaugh wrote Nov 26, 2012 at 10:55 PM

Thanks for reporting this. Marking 'active'. Better (well, working...) comment preservation will be one of the themes in a future release - in the meantime, if you get errors like this, it's best to omit the --comments flag.