From 94555c949a41d11dd4b60bd76580ef645c3a50a2 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 caa4e45c41247e..833271ef306309 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 61796a7d327bd4..c156e452e1b999 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 4cee49c74d2baa..94ddaf1cfa4072 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 2979064b322592..1a2f6777276da0 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',