Skip to content
This repository has been archived by the owner on Dec 31, 2017. It is now read-only.

inline return types often ignored #68

Open
wkeese opened this issue Jul 26, 2012 · 1 comment
Open

inline return types often ignored #68

wkeese opened this issue Jul 26, 2012 · 1 comment

Comments

@wkeese
Copy link
Collaborator

wkeese commented Jul 26, 2012

See for example dojox/gfx/matrix.js:

    scaleAt: function(a, b, c, d){
        // summary:
        //      scales a picture using a specified point as a center of scaling
        // description:
        //      Compare with dojox/gfx/matrix.scale().
        // a: Number
        //      a scaling factor used for the x coordinate, or a uniform scaling factor used for both coordinates
        // b: Number?
        //      a scaling factor used for the y coordinate
        // c: Number|Point
        //      an x component of a central point, or a central point
        // d: Number
        //      a y component of a central point

        switch(arguments.length){
            case 4:
                // a and b are scale factor components, c and d are components of a point
                return m._sandwich(m.scale(a, b), c, d); // dojox/gfx/matrix.Matrix2D
            case 3:
                if(typeof c == "number"){
                    return m._sandwich(m.scale(a), b, c); // dojox/gfx/matrix.Matrix2D
                }
                return m._sandwich(m.scale(a, b), c.x, c.y); // dojox/gfx/matrix.Matrix2D
        }
        return m._sandwich(m.scale(a), b.x, b.y); // dojox/gfx/matrix.Matrix2D
    },

The return type merely shows up as undefined. You can workaround by adding a

// returns: dojox/gfx/matrix.Matrix2D

to the top level summary section. (Therefore, to reproduce this bug, remove the // returns: ... from the top of the methods in that file.)

@neonstalwart
Copy link

i believe that d86cc3a in #80 would fix this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants