Pass the toKeyValue() test - parsing flags

This commit is contained in:
Vojta Jina 2010-10-16 16:18:41 +01:00 committed by Igor Minar
parent 46c6406b25
commit b08e2be64c

View file

@ -398,8 +398,8 @@ function parseKeyValue(/**string*/keyValue) {
function toKeyValue(obj) { function toKeyValue(obj) {
var parts = []; var parts = [];
foreach(obj, function(value, key){ foreach(obj, function(value, key) {
parts.push(escape(key) + '=' + escape(value)); parts.push(escape(key) + (value === true ? '' : '=' + escape(value)));
}); });
return parts.length ? parts.join('&') : ''; return parts.length ? parts.join('&') : '';
} }