Skip to content

Commit d458ab9

Browse files
fixed bug with WOQL.opt()
1 parent 1f1c936 commit d458ab9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/woql.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ WOQLQuery.prototype.prettyPrint = function(indent, show_context, q, embed){
286286
str += "(\n" + this.nspaces(indent) + "WOQL." + clauses.join(",\n"+ this.nspaces(indent) + "WOQL.") + "\n" + this.nspaces(indent - this.indent) + ")";
287287

288288
}
289-
else if(typeof val[val.length-1] == "object" ){
289+
else if(typeof val[val.length-1] == "object" && typeof val[val.length-1]['@value'] == "undefined"){
290290
var nvals = []
291291
for(var i = 0; i<val.length-1; i++){
292292
if(key == "limit" || key == "start"){
@@ -483,8 +483,8 @@ WOQLQuery.prototype.when = function(Query, Update){
483483

484484
WOQLQuery.prototype.opt = function(query){
485485
if(query){
486-
q = (query.json ? query.json() : q);
487-
this.cursor["opt"] = [query];
486+
q = (query.json ? query.json() : query);
487+
this.cursor["opt"] = [q];
488488
}
489489
else {
490490
this.cursor['opt'] = [{}];

0 commit comments

Comments
 (0)