diff options
author | Jordan Harband <ljharb@gmail.com> | 2023-01-09 21:38:36 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-10 05:38:36 +0000 |
commit | 757c10414776b6f035ced453599527a841f47d6e (patch) | |
tree | 8d51c5c789eb6832ab71a5cde64813c71a4f8879 /benchmark | |
parent | 5d9a9a6ba323916a978e737e6cee73c6df956afa (diff) | |
download | node-new-757c10414776b6f035ced453599527a841f47d6e.tar.gz |
tools: add `prefer-proto` rule
fixup: add support for `Object.create(null)`
fixup: extend to any 1-argument Object.create call
fixup: add tests
PR-URL: https://github.com/nodejs/node/pull/46083
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/es/map-bench.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/benchmark/es/map-bench.js b/benchmark/es/map-bench.js index 7e5e8824bf..c81cf57e5d 100644 --- a/benchmark/es/map-bench.js +++ b/benchmark/es/map-bench.js @@ -25,7 +25,7 @@ function runObject(n) { } function runNullProtoObject(n) { - const m = Object.create(null); + const m = { __proto__: null }; bench.start(); for (let i = 0; i < n; i++) { m[`i${i}`] = i; @@ -51,7 +51,7 @@ function runNullProtoLiteralObject(n) { } function StorageObject() {} -StorageObject.prototype = Object.create(null); +StorageObject.prototype = { __proto__: null }; function runStorageObject(n) { const m = new StorageObject(); |