@@ -100,7 +100,7 @@ fos.Router.prototype.getHost = function() {
100100fos . Router . prototype . buildQueryParams = function ( prefix , params , add ) {
101101 var self = this ;
102102 var name ;
103- var rbracket = new RegExp ( ' /\[\]$/' ) ;
103+ var rbracket = new RegExp ( / \[ \] $ / ) ;
104104
105105 if ( params instanceof Array ) {
106106 goog . array . forEach ( params , function ( val , i ) {
@@ -164,8 +164,7 @@ fos.Router.prototype.generate = function(name, opt_params, absolute) {
164164
165165 if ( 'variable' === token [ 0 ] ) {
166166 var hasDefault = goog . object . containsKey ( route . defaults , token [ 3 ] ) ;
167- if ( false === optional || ! hasDefault
168- || ( goog . object . containsKey ( params , token [ 3 ] ) && params [ token [ 3 ] ] != route . defaults [ token [ 3 ] ] ) ) {
167+ if ( false === optional || ! hasDefault || ( goog . object . containsKey ( params , token [ 3 ] ) && params [ token [ 3 ] ] != route . defaults [ token [ 3 ] ] ) ) {
169168 var value ;
170169 if ( goog . object . containsKey ( params , token [ 3 ] ) ) {
171170 value = params [ token [ 3 ] ] ;
@@ -222,7 +221,7 @@ fos.Router.prototype.generate = function(name, opt_params, absolute) {
222221 value = ( typeof value === 'function' ) ? value ( ) : value ;
223222
224223 // change null to empty string
225- value = ( value == null ) ? '' : value ;
224+ value = ( value === null ) ? '' : value ;
226225
227226 queryParams . push ( encodeURIComponent ( key ) + '=' + encodeURIComponent ( value ) ) ;
228227 } ;
0 commit comments