Browse Source

url: export URLSearchParams

Fixes: #10761
v7.x
Timothy Gu 8 years ago
committed by Italo A. Casas
parent
commit
021338dc6d
No known key found for this signature in database GPG Key ID: 23EFEFE93C4CFFFE
  1. 1
      lib/internal/url.js
  2. 1
      lib/url.js
  3. 8
      test/parallel/test-whatwg-url-searchparams-append.js
  4. 8
      test/parallel/test-whatwg-url-searchparams-constructor.js
  5. 10
      test/parallel/test-whatwg-url-searchparams-delete.js
  6. 12
      test/parallel/test-whatwg-url-searchparams-foreach.js
  7. 8
      test/parallel/test-whatwg-url-searchparams-get.js
  8. 9
      test/parallel/test-whatwg-url-searchparams-getall.js
  9. 8
      test/parallel/test-whatwg-url-searchparams-has.js
  10. 8
      test/parallel/test-whatwg-url-searchparams-set.js
  11. 8
      test/parallel/test-whatwg-url-searchparams-stringifier.js

1
lib/internal/url.js

@ -1022,6 +1022,7 @@ function domainToUnicode(domain) {
}
exports.URL = URL;
exports.URLSearchParams = URLSearchParams;
exports.originFor = originFor;
exports.domainToASCII = domainToASCII;
exports.domainToUnicode = domainToUnicode;

1
lib/url.js

@ -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;

8
test/parallel/test-whatwg-url-searchparams-append.js

@ -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();

8
test/parallel/test-whatwg-url-searchparams-constructor.js

@ -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();

10
test/parallel/test-whatwg-url-searchparams-delete.js

@ -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');

12
test/parallel/test-whatwg-url-searchparams-foreach.js

@ -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) {

8
test/parallel/test-whatwg-url-searchparams-get.js

@ -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');

9
test/parallel/test-whatwg-url-searchparams-getall.js

@ -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

8
test/parallel/test-whatwg-url-searchparams-has.js

@ -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');

8
test/parallel/test-whatwg-url-searchparams-set.js

@ -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');

8
test/parallel/test-whatwg-url-searchparams-stringifier.js

@ -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

Loading…
Cancel
Save