Permalink
Browse files

Suggestions now get assigned properly within the Result object

  • Loading branch information...
tstone committed Jun 24, 2012
1 parent 87be71a commit e1b2537b586b71928f2b9a308b6396dd388bb7c5
Showing with 3 additions and 3 deletions.
  1. +2 −1 src/checker.js
  2. +1 −2 src/result.js
View
@@ -31,7 +31,8 @@ Checker.prototype.check = function(s, callback){
} else {
var parser = new xml2js.Parser({ attrkey: 'attrs', charkey: 'chars' });
parser.parseString(body, function(err, result){
- if (typeof callback === 'function') { callback(undefined, new Result(result, text, this.config)); }
+ var r = new Result(result, text, this.config);
+ if (typeof callback === 'function') { callback(undefined, r); }
}.bind(this));
}
}.bind(this));
View
@@ -17,7 +17,6 @@ var Result = function(base, source, config) { this.__init(base, source, config);
} else {
this.suggestions = [];
}
-
};
cls.__parseSuggestions = function(xs){
@@ -43,7 +42,7 @@ var Result = function(base, source, config) { this.__init(base, source, config);
};
Array.isArray(xs) ? xs.forEach(addSug) : addSug(xs);
- this.suggestions = suggestions;
+ return suggestions;
};

0 comments on commit e1b2537

Please sign in to comment.