Coder Social home page Coder Social logo

Comments (6)

pruzand avatar pruzand commented on May 30, 2024

cc @wkeese

from js-doc-parse.

dmandrioli avatar dmandrioli commented on May 30, 2024

It seems that using only the "returns:" keyword gives an extra null or object return type:

    <return-types>
      <return-type type="Number" />
      <return-type type="null" />
    </return-types>

or

    <return-types>
      <return-type type="Number" />
      <return-type type="object" />
    </return-types>

from js-doc-parse.

pruzand avatar pruzand commented on May 30, 2024

In order to start the doc update of the source files, I would like to know what's planned to support return type documentation.
According to http://livedocs.dojotoolkit.org/util/doctools/markup,

  • the returns keyword "does not include a type, which should appear within the function"
  • "Because a function can return multiple types, the types should be declared on the same line as the return statement"

Do you plan to follow these guidelines ? In particular, that the "returns" key should not include the return type ?

from js-doc-parse.

cjolif avatar cjolif commented on May 30, 2024

we have tons of returns: Type, so I hope this will still be supported!

from js-doc-parse.

wkeese avatar wkeese commented on May 30, 2024

dojodoc.js::generateMetadata() has code for the doc-hints:

else if (value.raw.type === 'ReturnStatement') {
    // Comment at the end of the first line of the return statement, if one exists
    candidate = /^[^\n]*\/\/(.*?)\n/.exec(util.getSourceForRange(value.raw.range));

The problem is that generateMetadata() isn't called on return statement at all. Reproducible with a simple test case like:

define([], function(){
    return function(){
        return "foo";   // dojo/NodeList
     };
});

Looks like a problem in esprimaParser.js: Nothing inside the function is getting processed. (I can add a for() loop outside the function and see ForStatement getting called, but if the for() loop is inside the function ForStatement isn't called.)

from js-doc-parse.

neonstalwart avatar neonstalwart commented on May 30, 2024

i think this original issue would be fixed by d86cc3a in #80

from js-doc-parse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.