Skip to content

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

Youwotma opened this Issue Jan 21, 2014 · 1 comment

1 participant


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(;
        if (isNaN(idNumber)) {
            throw new Error('id is not a number');
        return idNumber;

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


(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
Something went wrong with that request. Please try again.