developerforce / Force.com-JavaScript-REST-Toolkit

ForceTK - a minimal Force.com REST API for JavaScript apps
BSD 3-Clause "New" or "Revised" License
315 stars 175 forks source link

forcetk.Client.prototype.blob code has broken variable name #74

Closed elijahdorman closed 9 years ago

elijahdorman commented 9 years ago

The signature for the function is

    forcetk.Client.prototype.blob = function(path, fields, filename, payloadField, payload, callback, error, retry) { 

But when the blob is called, the variable name is changed

                    } else if(request.status == 401 && !retry) {
                        that.refreshAccessToken(function(oauthResponse) {
                            that.setSessionToken(oauthResponse.access_token, null,oauthResponse.instance_url);
                            that.blob(path, fields, fileName, file, callback, error, true);
                        },
                        error);
                    } else {

A quick search of the file shows that fileName does not occur anywhere else in the file (and my linter agrees).

metadaddy commented 9 years ago

Wow - how did that happen? Thanks for filing this, @elijahdorman!

elijahdorman commented 9 years ago

@metadaddy-sfdc I didn't mention in my previous comment (my mistake) that the same line, the variable file is also an undefined variable (that name also doesn't occur anywhere else in the file).

metadaddy commented 9 years ago

Fixed this, and all JSLint errors/warnings, in e12fc02