Permalink
Browse files

benchmark: simplify URLSearchParams import

PR-URL: #11111
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
  • Loading branch information...
TimothyGu authored and italoacasas committed Feb 1, 2017
1 parent 5d58756 commit 94555c949a41d11dd4b60bd76580ef645c3a50a2
@@ -1,7 +1,7 @@
'use strict';
const common = require('../common.js');
const assert = require('assert');
-const URLSearchParams = new (require('url').URL)('a:').searchParams.constructor;
+const { URLSearchParams } = require('url');
const bench = common.createBenchmark(main, {
method: ['forEach', 'iterator'],
@@ -1,6 +1,6 @@
'use strict';
const common = require('../common.js');
-const URLSearchParams = new (require('url').URL)('a:').searchParams.constructor;
+const { URLSearchParams } = require('url');
const inputs = {
noencode: 'foo=bar&baz=quux&xyzzy=thud',
@@ -1,6 +1,6 @@
'use strict';
const common = require('../common.js');
-const URLSearchParams = new (require('url').URL)('a:').searchParams.constructor;
+const { URLSearchParams } = require('url');
const bench = common.createBenchmark(main, {
method: ['get', 'getAll', 'has'],
@@ -1,7 +1,7 @@
'use strict';
const common = require('../common.js');
const Buffer = require('buffer').Buffer;
-const URLSearchParams = new (require('url').URL)('a:').searchParams.constructor;
+const { URLSearchParams } = require('url');
const inputs = {
noencode: 'foo=bar&baz=quux&xyzzy=thud',

0 comments on commit 94555c9

Please sign in to comment.