Azure/node-sqlserver

error when array have a custom prototype

Jackcu opened this issue · 0 comments

 Array.prototype.contains = function (obj) {

        var i = this.length;
        while (i--) {
            if (this[i] === obj) {
                return true;
            }
        }

    }

function validateParameters( parameters, funcName ) {

for( var p in parameters ) {

    if ( isNaN( p ) ) continue;//myself code

    if( typeof parameters[p].value != parameters[p].type ) {

        throw new Error( ["[msnodesql] Invalid ", parameters[p].name, " passed to function ", funcName, ". Type should be ", parameters[p].type, "." ].join('') );
    }
}

}