Skip to content

Commit 970d83a

Browse files
committed
Remove weird quasi-promise interface on JS query
1 parent d3ec938 commit 970d83a

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

lib/query.js

-17
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,6 @@ var Query = function(config, values, callback) {
4040

4141
util.inherits(Query, EventEmitter);
4242

43-
Query.prototype.then = function(onSuccess, onFailure) {
44-
return this.promise().then(onSuccess, onFailure);
45-
};
46-
47-
Query.prototype.catch = function(callback) {
48-
return this.promise().catch(callback);
49-
};
50-
51-
Query.prototype.promise = function() {
52-
if (this._promise) return this._promise;
53-
this._promise = new Promise(function(resolve, reject) {
54-
this.once('end', resolve);
55-
this.once('error', reject);
56-
}.bind(this));
57-
return this._promise;
58-
};
59-
6043
Query.prototype.requiresPreparation = function() {
6144
//named queries must always be prepared
6245
if(this.name) { return true; }

0 commit comments

Comments
 (0)