diff options
author | Timothy Gu <timothygu99@gmail.com> | 2017-03-19 16:11:10 -0700 |
---|---|---|
committer | Timothy Gu <timothygu99@gmail.com> | 2017-03-24 15:25:49 -0700 |
commit | cfc8422a68c92808a4a2aee374623bebc768522a (patch) | |
tree | a5ca63de5fee40991d49a5731fe32e3072f097b0 /lib/url.js | |
parent | 14a91957f8bce2d614ec361f982aa56378f1c24e (diff) | |
download | android-node-v8-cfc8422a68c92808a4a2aee374623bebc768522a.tar.gz android-node-v8-cfc8422a68c92808a4a2aee374623bebc768522a.tar.bz2 android-node-v8-cfc8422a68c92808a4a2aee374623bebc768522a.zip |
lib: use Object.create(null) directly
After V8 5.6, using Object.create(null) directly is now faster than
using a constructor for map-like objects.
PR-URL: https://github.com/nodejs/node/pull/11930
Refs: https://github.com/emberjs/ember.js/issues/15001
Refs: https://crrev.com/532c16eca071df3ec8eed394dcebb932ef584ee6
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/url.js')
-rw-r--r-- | lib/url.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/url.js b/lib/url.js index 395a583cb7..4b2ef9b68e 100644 --- a/lib/url.js +++ b/lib/url.js @@ -23,7 +23,7 @@ const { toASCII } = process.binding('config').hasIntl ? process.binding('icu') : require('punycode'); -const { StorageObject, hexTable } = require('internal/querystring'); +const { hexTable } = require('internal/querystring'); const internalUrl = require('internal/url'); exports.parse = urlParse; exports.resolve = urlResolve; @@ -197,7 +197,7 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { } } else if (parseQueryString) { this.search = ''; - this.query = new StorageObject(); + this.query = Object.create(null); } return this; } @@ -390,7 +390,7 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { } else if (parseQueryString) { // no query string, but parseQueryString still requested this.search = ''; - this.query = new StorageObject(); + this.query = Object.create(null); } var firstIdx = (questionIdx !== -1 && |