@@ -1113,7 +1113,7 @@ var formatTests = {
1113
1113
1114
1114
// `#`,`?` in path
1115
1115
'/path/to/%%23%3F+=&.txt?foo=theA1#bar' : {
1116
- href : '/path/to/%%23%3F+=&.txt?foo=theA1#bar' ,
1116
+ href : '/path/to/%%23%3F+=&.txt?foo=theA1#bar' ,
1117
1117
pathname : '/path/to/%#?+=&.txt' ,
1118
1118
query : {
1119
1119
foo : 'theA1'
@@ -1123,7 +1123,7 @@ var formatTests = {
1123
1123
1124
1124
// `#`,`?` in path + `#` in query
1125
1125
'/path/to/%%23%3F+=&.txt?foo=the%231#bar' : {
1126
- href : '/path/to/%%23%3F+=&.txt?foo=the%231#bar' ,
1126
+ href : '/path/to/%%23%3F+=&.txt?foo=the%231#bar' ,
1127
1127
pathname : '/path/to/%#?+=&.txt' ,
1128
1128
query : {
1129
1129
foo : 'the#1'
@@ -1138,7 +1138,7 @@ var formatTests = {
1138
1138
hostname : 'ex.com' ,
1139
1139
hash : '#frag' ,
1140
1140
search : '?abc=the#1?&foo=bar' ,
1141
- pathname : '/foo?100%m#r'
1141
+ pathname : '/foo?100%m#r' ,
1142
1142
} ,
1143
1143
1144
1144
// `?` and `#` in search only
@@ -1148,77 +1148,8 @@ var formatTests = {
1148
1148
hostname : 'ex.com' ,
1149
1149
hash : '#frag' ,
1150
1150
search : '?abc=the#1?&foo=bar' ,
1151
- pathname : '/fooA100%mBr'
1152
- } ,
1153
-
1154
- // path
1155
- 'http://github.com/joyent/node#js1' : {
1156
- href : 'http://github.com/joyent/node#js1' ,
1157
- protocol : 'http:' ,
1158
- hostname : 'github.com' ,
1159
- hash : '#js1' ,
1160
- path : '/joyent/node'
1161
- } ,
1162
-
1163
- // pathname vs. path, path wins
1164
- 'http://github.com/joyent/node2#js1' : {
1165
- href : 'http://github.com/joyent/node2#js1' ,
1166
- protocol : 'http:' ,
1167
- hostname : 'github.com' ,
1168
- hash : '#js1' ,
1169
- path : '/joyent/node2' ,
1170
- pathname : '/joyent/node'
1171
- } ,
1172
-
1173
- // pathname with query/search
1174
- 'http://github.com/joyent/node?foo=bar#js2' : {
1175
- href : 'http://github.com/joyent/node?foo=bar#js2' ,
1176
- protocol : 'http:' ,
1177
- hostname : 'github.com' ,
1178
- hash : '#js2' ,
1179
- path : '/joyent/node?foo=bar'
1180
- } ,
1181
-
1182
- // path vs. query, path wins
1183
- 'http://github.com/joyent/node?foo=bar2#js3' : {
1184
- href : 'http://github.com/joyent/node?foo=bar2#js3' ,
1185
- protocol : 'http:' ,
1186
- hostname : 'github.com' ,
1187
- hash : '#js3' ,
1188
- path : '/joyent/node?foo=bar2' ,
1189
- query : { foo : 'bar' }
1190
- } ,
1191
-
1192
- // path vs. search, path wins
1193
- 'http://github.com/joyent/node?foo=bar3#js4' : {
1194
- href : 'http://github.com/joyent/node?foo=bar3#js4' ,
1195
- protocol : 'http:' ,
1196
- hostname : 'github.com' ,
1197
- hash : '#js4' ,
1198
- path : '/joyent/node?foo=bar3' ,
1199
- search : '?foo=bar'
1200
- } ,
1201
-
1202
- // path is present without ? vs. query given
1203
- 'http://github.com/joyent/node#js5' : {
1204
- href : 'http://github.com/joyent/node#js5' ,
1205
- protocol : 'http:' ,
1206
- hostname : 'github.com' ,
1207
- hash : '#js5' ,
1208
- path : '/joyent/node' ,
1209
- query : { foo : 'bar' }
1210
- } ,
1211
-
1212
- // path is present without ? vs. search given
1213
- 'http://github.com/joyent/node#js6' : {
1214
- href : 'http://github.com/joyent/node#js6' ,
1215
- protocol : 'http:' ,
1216
- hostname : 'github.com' ,
1217
- hash : '#js6' ,
1218
- path : '/joyent/node' ,
1219
- search : '?foo=bar'
1151
+ pathname : '/fooA100%mBr' ,
1220
1152
}
1221
-
1222
1153
} ;
1223
1154
for ( var u in formatTests ) {
1224
1155
var expect = formatTests [ u ] . href ;
0 commit comments