[Pkg-javascript-commits] [dojo] 117/149: fixes #17628, allow null query with JsonRest

David Prévot taffit at moszumanska.debian.org
Sat Feb 27 03:13:54 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository dojo.

commit 81f846d7a0de94e323a0f5ab4624b26091c4bc03
Author: Dylan Schiemann <dylan at dojotoolkit.org>
Date:   Wed Dec 30 05:56:58 2015 -0700

    fixes #17628, allow null query with JsonRest
---
 store/JsonRest.js            |  1 +
 tests/unit/store/JsonRest.js | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/store/JsonRest.js b/store/JsonRest.js
index 05c3af3..6e8669d 100644
--- a/store/JsonRest.js
+++ b/store/JsonRest.js
@@ -180,6 +180,7 @@ return declare("dojo.store.JsonRest", base, {
 		var headers = lang.mixin({ Accept: this.accepts }, this.headers, options.headers);
 
 		var hasQuestionMark = this.target.indexOf("?") > -1;
+		query = query || ""; // https://bugs.dojotoolkit.org/ticket/17628
 		if(query && typeof query == "object"){
 			query = xhr.objectToQuery(query);
 			query = query ? (hasQuestionMark ? "&" : "?") + query: "";
diff --git a/tests/unit/store/JsonRest.js b/tests/unit/store/JsonRest.js
index fa7e0ea..48f9381 100644
--- a/tests/unit/store/JsonRest.js
+++ b/tests/unit/store/JsonRest.js
@@ -139,6 +139,16 @@ define([
 				}), lang.hitch(dfd, 'reject'));
 			},
 
+			'null query': function () {
+				var dfd = this.async();
+
+				store.query().then(dfd.callback(function (results) {
+					var object = results[0];
+					assert.equal(object.name, 'node1');
+					assert.equal(object.someProperty, 'somePropertyA');
+				}), lang.hitch(dfd, 'reject'));
+			},
+
 			'result iteration': function () {
 				var dfd = this.async();
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git



More information about the Pkg-javascript-commits mailing list