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