ReferenceError: data is not defined in jugglingdb/lib/sql.js:49 #361

Closed
dvdbng opened this Issue Jan 21, 2014 · 1 comment

Comments

Projects
None yet
1 participant
@dvdbng

dvdbng commented Jan 21, 2014

With the recent update (v0.2.9), I get this error.

The code doesn't appear to be in the repository, but the function goes like this

BaseSQL.prototype.escapeId = function(id) {
    if (this.schema.settings.slave) {
        return '"' + id.toString().replace(/["\n]/g, '') + '"';
    } else {
        var idNumber = Number(data.id);
        if (isNaN(idNumber)) {
            throw new Error('id is not a number');
        }
        return idNumber;
    }
}

And changing var idNumber = Number(data.id); for var idNumber = Number(id); works

@dvdbng

This comment has been minimized.

Show comment
Hide comment
@dvdbng

dvdbng Jan 21, 2014

(Also, a semi colon at the end of the function would be nice to keep JSHint quiet)

dvdbng commented Jan 21, 2014

(Also, a semi colon at the end of the function would be nice to keep JSHint quiet)

@1602 1602 closed this in 4b77f35 Jan 21, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment