From 590626ba11ecb68c53a8091c74b6bd098d944203 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Wed, 1 Feb 2017 15:59:16 -0800 Subject: [PATCH] benchmark: simplify URLSearchParams import MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/11111 Reviewed-By: Yuta Hiroto Reviewed-By: Michaƫl Zasso Reviewed-By: Joyee Cheung Reviewed-By: James M Snell Reviewed-By: Italo A. Casas --- benchmark/url/url-searchparams-iteration.js | 2 +- benchmark/url/url-searchparams-parse.js | 2 +- benchmark/url/url-searchparams-read.js | 2 +- benchmark/url/url-searchparams-stringifier.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/benchmark/url/url-searchparams-iteration.js b/benchmark/url/url-searchparams-iteration.js index caa4e45c41..833271ef30 100644 --- a/benchmark/url/url-searchparams-iteration.js +++ b/benchmark/url/url-searchparams-iteration.js @@ -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'], diff --git a/benchmark/url/url-searchparams-parse.js b/benchmark/url/url-searchparams-parse.js index 61796a7d32..c156e452e1 100644 --- a/benchmark/url/url-searchparams-parse.js +++ b/benchmark/url/url-searchparams-parse.js @@ -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', diff --git a/benchmark/url/url-searchparams-read.js b/benchmark/url/url-searchparams-read.js index 4cee49c74d..94ddaf1cfa 100644 --- a/benchmark/url/url-searchparams-read.js +++ b/benchmark/url/url-searchparams-read.js @@ -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'], diff --git a/benchmark/url/url-searchparams-stringifier.js b/benchmark/url/url-searchparams-stringifier.js index 2979064b32..1a2f677727 100644 --- a/benchmark/url/url-searchparams-stringifier.js +++ b/benchmark/url/url-searchparams-stringifier.js @@ -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',