fix js/native api inconsistency
This commit is contained in:
parent
293eaf8b0f
commit
24b664efbd
@ -100,11 +100,17 @@ var ctor = function(config) {
|
|||||||
|
|
||||||
//event emitter proxy
|
//event emitter proxy
|
||||||
var NativeQuery = function(text, values, callback) {
|
var NativeQuery = function(text, values, callback) {
|
||||||
|
//TODO there are better ways to detect overloads
|
||||||
if(typeof text == 'object') {
|
if(typeof text == 'object') {
|
||||||
this.text = text.text;
|
this.text = text.text;
|
||||||
this.values = text.values;
|
this.values = text.values;
|
||||||
this.name = text.name;
|
this.name = text.name;
|
||||||
|
if(typeof values === 'function') {
|
||||||
this.callback = values;
|
this.callback = values;
|
||||||
|
} else if(typeof values !== 'undefined') {
|
||||||
|
this.values = values;
|
||||||
|
this.callback = callback;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.text = text;
|
this.text = text;
|
||||||
this.values = values;
|
this.values = values;
|
||||||
|
Loading…
Reference in New Issue
Block a user