From 3ac6c2be2fddb0cddcad86bd94bcc570f657497d 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 --- 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',