Timothy Gu
8 years ago
committed by
Italo A. Casas
No known key found for this signature in database
GPG Key ID: 23EFEFE93C4CFFFE
11 changed files with
24 additions and
57 deletions
-
lib/internal/url.js
-
lib/url.js
-
test/parallel/test-whatwg-url-searchparams-append.js
-
test/parallel/test-whatwg-url-searchparams-constructor.js
-
test/parallel/test-whatwg-url-searchparams-delete.js
-
test/parallel/test-whatwg-url-searchparams-foreach.js
-
test/parallel/test-whatwg-url-searchparams-get.js
-
test/parallel/test-whatwg-url-searchparams-getall.js
-
test/parallel/test-whatwg-url-searchparams-has.js
-
test/parallel/test-whatwg-url-searchparams-set.js
-
test/parallel/test-whatwg-url-searchparams-stringifier.js
|
|
@ -1022,6 +1022,7 @@ function domainToUnicode(domain) { |
|
|
|
} |
|
|
|
|
|
|
|
exports.URL = URL; |
|
|
|
exports.URLSearchParams = URLSearchParams; |
|
|
|
exports.originFor = originFor; |
|
|
|
exports.domainToASCII = domainToASCII; |
|
|
|
exports.domainToUnicode = domainToUnicode; |
|
|
|
|
|
@ -17,6 +17,7 @@ exports.resolve = urlResolve; |
|
|
|
exports.resolveObject = urlResolveObject; |
|
|
|
exports.format = urlFormat; |
|
|
|
exports.URL = internalUrl.URL; |
|
|
|
exports.URLSearchParams = internalUrl.URLSearchParams; |
|
|
|
exports.originFor = internalUrl.originFor; |
|
|
|
exports.domainToASCII = internalUrl.domainToASCII; |
|
|
|
exports.domainToUnicode = internalUrl.domainToUnicode; |
|
|
|
|
|
@ -2,13 +2,9 @@ |
|
|
|
|
|
|
|
require('../common'); |
|
|
|
const assert = require('assert'); |
|
|
|
const URL = require('url').URL; |
|
|
|
const URLSearchParams = require('url').URLSearchParams; |
|
|
|
|
|
|
|
const m = new URL('http://example.org'); |
|
|
|
let params = m.searchParams; |
|
|
|
|
|
|
|
// Until we export URLSearchParams
|
|
|
|
const URLSearchParams = params.constructor; |
|
|
|
let params; |
|
|
|
|
|
|
|
// Append same name
|
|
|
|
params = new URLSearchParams(); |
|
|
|
|
|
@ -2,13 +2,9 @@ |
|
|
|
|
|
|
|
require('../common'); |
|
|
|
const assert = require('assert'); |
|
|
|
const URL = require('url').URL; |
|
|
|
const URLSearchParams = require('url').URLSearchParams; |
|
|
|
|
|
|
|
const m = new URL('http://example.org'); |
|
|
|
let params = m.searchParams; |
|
|
|
|
|
|
|
// Until we export URLSearchParams
|
|
|
|
const URLSearchParams = params.constructor; |
|
|
|
let params; |
|
|
|
|
|
|
|
// Basic URLSearchParams construction
|
|
|
|
params = new URLSearchParams(); |
|
|
|
|
|
@ -2,13 +2,11 @@ |
|
|
|
|
|
|
|
require('../common'); |
|
|
|
const assert = require('assert'); |
|
|
|
const URL = require('url').URL; |
|
|
|
const url = require('url'); |
|
|
|
const URL = url.URL; |
|
|
|
const URLSearchParams = url.URLSearchParams; |
|
|
|
|
|
|
|
const m = new URL('http://example.org'); |
|
|
|
let params = m.searchParams; |
|
|
|
|
|
|
|
// Until we export URLSearchParams
|
|
|
|
const URLSearchParams = params.constructor; |
|
|
|
let params; |
|
|
|
|
|
|
|
// Delete basics
|
|
|
|
params = new URLSearchParams('a=b&c=d'); |
|
|
|
|
|
@ -2,18 +2,14 @@ |
|
|
|
|
|
|
|
require('../common'); |
|
|
|
const assert = require('assert'); |
|
|
|
const URL = require('url').URL; |
|
|
|
|
|
|
|
const m = new URL('http://example.org'); |
|
|
|
let params = m.searchParams; |
|
|
|
|
|
|
|
// Until we export URLSearchParams
|
|
|
|
const URLSearchParams = params.constructor; |
|
|
|
const url = require('url'); |
|
|
|
const URL = url.URL; |
|
|
|
const URLSearchParams = url.URLSearchParams; |
|
|
|
|
|
|
|
let a, b, i; |
|
|
|
|
|
|
|
// ForEach Check
|
|
|
|
params = new URLSearchParams('a=1&b=2&c=3'); |
|
|
|
const params = new URLSearchParams('a=1&b=2&c=3'); |
|
|
|
const keys = []; |
|
|
|
const values = []; |
|
|
|
params.forEach(function(value, key) { |
|
|
|
|
|
@ -2,13 +2,9 @@ |
|
|
|
|
|
|
|
require('../common'); |
|
|
|
const assert = require('assert'); |
|
|
|
const URL = require('url').URL; |
|
|
|
const URLSearchParams = require('url').URLSearchParams; |
|
|
|
|
|
|
|
const m = new URL('http://example.org'); |
|
|
|
let params = m.searchParams; |
|
|
|
|
|
|
|
// Until we export URLSearchParams
|
|
|
|
const URLSearchParams = params.constructor; |
|
|
|
let params; |
|
|
|
|
|
|
|
// Get basics
|
|
|
|
params = new URLSearchParams('a=b&c=d'); |
|
|
|
|
|
@ -2,14 +2,9 @@ |
|
|
|
|
|
|
|
require('../common'); |
|
|
|
const assert = require('assert'); |
|
|
|
const URL = require('url').URL; |
|
|
|
|
|
|
|
const m = new URL('http://example.org'); |
|
|
|
let params = m.searchParams; |
|
|
|
|
|
|
|
// Until we export URLSearchParams
|
|
|
|
const URLSearchParams = params.constructor; |
|
|
|
const URLSearchParams = require('url').URLSearchParams; |
|
|
|
|
|
|
|
let params; |
|
|
|
let matches; |
|
|
|
|
|
|
|
// getAll() basics
|
|
|
|
|
|
@ -2,13 +2,9 @@ |
|
|
|
|
|
|
|
require('../common'); |
|
|
|
const assert = require('assert'); |
|
|
|
const URL = require('url').URL; |
|
|
|
const URLSearchParams = require('url').URLSearchParams; |
|
|
|
|
|
|
|
const m = new URL('http://example.org'); |
|
|
|
let params = m.searchParams; |
|
|
|
|
|
|
|
// Until we export URLSearchParams
|
|
|
|
const URLSearchParams = params.constructor; |
|
|
|
let params; |
|
|
|
|
|
|
|
// Has basics
|
|
|
|
params = new URLSearchParams('a=b&c=d'); |
|
|
|
|
|
@ -2,13 +2,9 @@ |
|
|
|
|
|
|
|
require('../common'); |
|
|
|
const assert = require('assert'); |
|
|
|
const URL = require('url').URL; |
|
|
|
const URLSearchParams = require('url').URLSearchParams; |
|
|
|
|
|
|
|
const m = new URL('http://example.org'); |
|
|
|
let params = m.searchParams; |
|
|
|
|
|
|
|
// Until we export URLSearchParams
|
|
|
|
const URLSearchParams = params.constructor; |
|
|
|
let params; |
|
|
|
|
|
|
|
// Set basics
|
|
|
|
params = new URLSearchParams('a=b&c=d'); |
|
|
|
|
|
@ -2,13 +2,9 @@ |
|
|
|
|
|
|
|
require('../common'); |
|
|
|
const assert = require('assert'); |
|
|
|
const URL = require('url').URL; |
|
|
|
const URLSearchParams = require('url').URLSearchParams; |
|
|
|
|
|
|
|
const m = new URL('http://example.org'); |
|
|
|
let params = m.searchParams; |
|
|
|
|
|
|
|
// Until we export URLSearchParams
|
|
|
|
const URLSearchParams = params.constructor; |
|
|
|
let params; |
|
|
|
|
|
|
|
// Serialize space
|
|
|
|
// querystring does not currently handle spaces intelligently
|
|
|
|