fix jshint errors for lib/result.js

This commit is contained in:
Philipp Borgers 2013-01-21 14:38:04 +01:00
parent 5e92546a30
commit 28afce25ed

View File

@ -10,26 +10,27 @@ var Result = function() {
var p = Result.prototype;
var matchRegexp = /([A-Za-z]+) (\d+ )?(\d+)?/
var matchRegexp = /([A-Za-z]+) (\d+ )?(\d+)?/;
//adds a command complete message
p.addCommandComplete = function(msg) {
var match;
if(msg.text) {
//pure javascript
var match = matchRegexp.exec(msg.text);
match = matchRegexp.exec(msg.text);
} else {
//native bindings
var match = matchRegexp.exec(msg.command);
match = matchRegexp.exec(msg.command);
}
if(match) {
this.command = match[1];
//match 3 will only be existing on insert commands
if(match[3]) {
//msg.value is from native bindings
this.rowCount = parseInt(match[3] || msg.value);
this.oid = parseInt(match[2]);
this.rowCount = parseInt(match[3] || msg.value, 10);
this.oid = parseInt(match[2], 10);
} else {
this.rowCount = parseInt(match[2]);
this.rowCount = parseInt(match[2], 10);
}
}
};