csnover / js-doc-parse

An experimental library for parsing JavaScript files and extracting inline documentation.
31 stars 7 forks source link

defer resolving the annotated object. #82

Closed neonstalwart closed 11 years ago

neonstalwart commented 11 years ago

by resolving this in the exporter, we can avoid a race condtion where sometimes relatedModule had not been indicated when it should have been.

an example of what this fixes can be seen in dojo/_base/Color where the annotated type of a parameter is the return value of the same module. it's roughly equivalent to what's outlined in the code below

define([], function () {
    var Color = function () {}

    Color.prototype.blendColors = function (/*Color*/ start, /*Color*/end, ...) { ... };

    return Color;
});

when the type annotation for start and end are processed, the parser has not marked Color with a relatedModule and so the properties of Color are iterated to produce an "additional description" - this is wrong.

this effectively includes #81 so i'll close that in favor of this

neonstalwart commented 11 years ago

...and #80 includes this one now, so bye bye.