Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[9.x backport] 17560, 18471, 18509 #18891

Closed
wants to merge 131 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
5ab0626
doc: add missing link references
vsemozhetbyt Jan 18, 2018
a7a712b
inspector: --inspect-brk for es modules
guybedford Jan 16, 2018
130d6f3
test: fix a bug & lint issues in inspector-helper
apapirovski Jan 22, 2018
3d7bdb4
test: fix flaky cluster unix socket test
bnoordhuis Jan 20, 2018
87648e2
test: force context allocation in test module
hashseed Jan 23, 2018
384d4e4
http: switch on string values
sethbrenith Jan 24, 2018
f4fbcf3
domain: further abstract usage in C++
apapirovski Jan 19, 2018
f86f6a7
doc: Update tools/icu/README.md
srl295 Nov 10, 2017
f48b47c
tools: fix icu readme lint error
apapirovski Jan 30, 2018
835807e
doc: warn about GCM authenticity
tniessen Jan 25, 2018
08a93ef
doc: fix manpage warnings
silverwind Jan 29, 2018
8dc159d
doc: add pending-deprecation to COLLABORATOR_GUIDE
ChALkeR Jan 29, 2018
1b7618d
doc: reorder section on updating PR branch
ofrobots Jan 24, 2018
10b3345
src: fix vector subscript out of range
apapirovski Jan 30, 2018
1c06909
url: simplify loop in parser
tniessen Jan 30, 2018
fea9f94
doc: add Gibson Fahnestock to TSC
Trott Jan 31, 2018
c8b92e2
n-api: change assert ok check to notStrictEqual.
nbdaaron Jan 27, 2018
0915a85
perf_hooks: add warning when too many entries in the timeline
jasnell Jan 10, 2018
3e6609b
doc: linkify missing types
vsemozhetbyt Jan 29, 2018
dba6652
test: move tmpdir to submodule of common
Trott Dec 25, 2017
1c9ab28
test: fix flaky test-http-dns-error
bengl Oct 26, 2017
16e918c
http: process headers after setting up agent
rvagg Oct 24, 2017
6d3862d
crypto: use non-deprecated v8::Object::Set
danbev Dec 6, 2017
f023d58
benchmark: fix platform in basename-win32
BridgeAR Jan 23, 2018
0ac2a9d
benchmark: fix variables not being set
BridgeAR Jan 23, 2018
d20e524
benchmark: (assert) refactor
BridgeAR Jan 23, 2018
4f09f08
benchmark: (buffer) refactor
BridgeAR Jan 23, 2018
3d205a3
benchmark: (crypto) refactor
BridgeAR Jan 23, 2018
10a560a
benchmark: (url) refactor
BridgeAR Jan 23, 2018
5213f8c
benchmark: (es) refactor
BridgeAR Jan 23, 2018
0d7b697
benchmark: (http(2)) refactor
BridgeAR Jan 23, 2018
bb808e3
benchmark: (timers) refactor
BridgeAR Jan 23, 2018
8aabb86
benchmark: refactor
BridgeAR Jan 23, 2018
6f2c51c
src: free memory before re-setting URLHost value
prog1dev Jan 23, 2018
3a15d71
tools: auto fix custom eslint rule
shobhitchittora Oct 31, 2017
aa90b1a
benchmark: cut down http benchmark run time
joyeecheung Jan 25, 2018
4dff070
doc: improve stream documentation
Jan 25, 2018
f939aa7
test: speed up parallel/test-tls-session-cache
addaleax Jan 29, 2018
0429820
lib: extract validation functions
timotew Jan 28, 2018
bbd2ff2
test: show pending exception error in napi tests
reccanti Jan 27, 2018
20f33e4
benchmark: shorten config name in http benchmark
joyeecheung Jan 30, 2018
bdd57cf
lib: remove debugger dead code
liqyan Jan 22, 2018
06051b9
src: allow --perf-(basic-)?prof in NODE_OPTIONS
Leko Dec 11, 2017
a1e45b2
deps: update node-inspect to 1.11.3
Jan 24, 2018
dfa467f
benchmark: spread operator benchmark
jasnell Jan 29, 2018
3d8db8b
test: mark test-inspector-stop-profile-after-done flaky
MylesBorins Feb 1, 2018
b2eff72
async_hooks: clean up comments
ofrobots Jan 30, 2018
a418ae5
doc: move Brian White to TSC Emeriti list
Trott Jan 31, 2018
8d37cca
stream: delete redundant code
Jan 14, 2018
524f93f
stream: delete redundant code
Jan 15, 2018
582fa6a
process: fix reading zero-length env vars on win32
addaleax Jan 30, 2018
c7f1482
v8: add missing ',' in OpenBSD's 'sources' section.
qbit Jan 30, 2018
680ca8a
build: add cflags for OpenBSD, remove stray comma.
qbit Jan 30, 2018
8621f55
doc: streamline README intro
Trott Jan 31, 2018
9a8bc9a
string_decoder: reset decoder on end
jridgewell Feb 1, 2018
fe32d68
stream: delete unused code
Jan 21, 2018
1385daf
n-api: implement wrapping using private properties
Jan 23, 2018
d737972
net: remove redundant code from _writeGeneric()
lpinca Jan 29, 2018
35d3df9
test: add test for tls benchmarks
apapirovski Feb 1, 2018
e079247
http: remove domain specific code
apapirovski Jan 29, 2018
3962051
timers: remove domain specific code
apapirovski Jan 29, 2018
c76d380
doc: remove removed apis from http2 docs
kjin Jan 29, 2018
aecc551
test: verify the shell option works properly on execFile
jvelezpo Jan 25, 2018
c573804
win, build: fix intl-none option
poiru Jan 22, 2018
7dda624
doc: improve http.request documentation
Zarel Jan 8, 2018
8e0989e
doc: shell option for the execFile and execFileSync functions
jvelezpo Jan 18, 2018
e31a6b7
build: allow x86_64 as a dest_cpu alias for x64
rvagg Jan 9, 2018
46b8481
tools: non-Ascii linter for /lib only
SirR4T Jan 8, 2018
48220ed
src, lib: return promises from link
devsnek Jan 26, 2018
9f2b4c4
tools: add .mjs linting for Windows
vsemozhetbyt Feb 4, 2018
4195f3b
test: remove destructor from node_test_fixture
danbev Feb 2, 2018
eda9456
stream: cleanup() when unpiping all streams.
Jan 20, 2018
2150e1e
n-api: wrap control flow macro in do/while
bnoordhuis Feb 2, 2018
53094da
doc: expand on promises and async_hooks
ofrobots Feb 2, 2018
1436a9c
doc: remove usage of you in n-api doc
mhdawson Feb 2, 2018
04e76b8
doc: add section for strategic initiatives
mhdawson Nov 17, 2017
75d3416
doc: small typo in n-api.md
iSkore Feb 4, 2018
701e372
n-api: add methods to open/close callback scope
mhdawson Dec 13, 2017
cf588e0
n-api: remove extra reference from test
Feb 3, 2018
b439ded
test: improve tests for test-http-url.parse
starkwang Feb 2, 2018
2d7fe3d
doc: add introduce about cli options
starkwang Jan 31, 2018
529f42c
build: add doc linting when runnning `make lint`
camilo86 Jan 31, 2018
07d39c7
doc: fix typo in n-api.md
vsemozhetbyt Feb 6, 2018
984570d
src: fix crypto.pbkdf2 callback error argument
BufoViridis Jan 30, 2018
4dd13c7
doc: modify the return value of request.write()
Feb 2, 2018
0557bec
doc: update onboarding-extras
devsnek Feb 3, 2018
f252c16
http: add options to http.createServer()
Oct 19, 2017
9de08f6
http2: add http fallback options to .createServer
hekike Oct 27, 2017
420a907
doc: fix typo in http2.md
vsemozhetbyt Feb 6, 2018
cf8c432
doc: add missing "changes" key in YAML comment
lpinca Feb 6, 2018
9aea92e
tools: add fixer for prefer-assert-iferror.js
shobhitchittora Oct 31, 2017
c230219
test: do not check TXT content in test-dns-any
joyeecheung Feb 3, 2018
298ee05
test: fix flaky test-http2-session-unref
apapirovski Feb 5, 2018
94f5e95
doc: be more explicit in the sypnosis
timotew Jan 4, 2018
fb15e3a
test: improve error message output
bshankar Feb 1, 2018
3f73b7f
readline: use Date.now() and move test to parallel
apapirovski Feb 4, 2018
f422b82
test: refactor test-http-abort-before-end
cjihrig Feb 1, 2018
ff05d54
doc: fix link in https.md
vsemozhetbyt Feb 7, 2018
67bd099
doc: fix MDN links to avoid redirections
vsemozhetbyt Feb 7, 2018
127487a
src: don't abort when package.json is a directory
bnoordhuis Jan 20, 2018
8722a0f
build: do not suppress output in make doc-only
joyeecheung Feb 1, 2018
8dc7713
stream: fix misleading error message
lpinca Feb 6, 2018
10e861c
benchmark: improve compare output
BridgeAR Feb 5, 2018
081c6ae
net: remove Socket.prototoype.read
addaleax Feb 4, 2018
59c1cfc
test: fix flaky timers-block-eventloop test
apapirovski Feb 4, 2018
85a4cec
test: properly tag anonymous namespaces
mhdawson Feb 5, 2018
27d10a5
doc: fix description of createDecipheriv
tniessen Feb 8, 2018
1d0be7c
doc: add missing meta for createCipheriv
tniessen Feb 8, 2018
dc44a2e
doc: fix links in YAML metadata of assert.md
vsemozhetbyt Feb 9, 2018
557ec07
doc: add devsnek to collaborators
devsnek Feb 9, 2018
5dbe33c
http2: add req and res options to server creation
Oct 5, 2017
ba05498
doc: fix links to Style Guide and CPP Style Guide
justin0022 Feb 9, 2018
44e4999
src: add "icu::" prefix before ICU symbols
srl295 Feb 8, 2018
f5d8a23
https: add extra options to Agent#getName()
princjef Oct 17, 2017
1462b86
src: replace var for let / const.
estrada9166 Feb 8, 2018
cd1f35d
fs: fix stack overflow in fs.readdirSync
joyeecheung Feb 8, 2018
2433c87
doc: add history for url.parse
styfle Feb 9, 2018
083c6f8
doc: fix exporting a function example
Feb 8, 2018
2bbc5dd
buffer: simplify check size in assertSize
Connormiha Feb 8, 2018
a53067c
build: no longer have v8-debug.h as dependency.
hashseed Feb 9, 2018
38451b9
doc: add error check to fs example
evanlucas Feb 9, 2018
28207e3
test: fix flaky repl-timeout-throw
santigimeno Feb 10, 2018
3bf8481
doc: mark NAPI_AUTO_LENGTH as code
tniessen Feb 10, 2018
f1ff107
url: simplify constructor URLSearchParams. Remove needless check null
Connormiha Feb 10, 2018
9da102f
async_hooks: rename PromiseWrap.parentId
ofrobots Feb 8, 2018
80cd943
tools: fix eslint isRequired
BridgeAR Feb 12, 2018
0315dd0
src: flatten ContextifyContext
devsnek Dec 9, 2017
993f943
src: factor out some common vm functions
TimothyGu Jan 13, 2018
0875753
vm: add modules
devsnek Jan 14, 2018
c401321
vm: flip Module#link's signature
devsnek Jan 31, 2018
f934e4b
loader: fix up #18394
devsnek Feb 1, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 13 additions & 9 deletions COLLABORATOR_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,10 @@ Node.js uses three Deprecation levels:
being staged for deprecation in a future Node.js major release. An explicit
notice indicating the deprecated status is added to the API documentation
but no functional changes are implemented in the code. There will be no
runtime deprecation warnings emitted for such deprecations.
runtime deprecation warnings emitted for such deprecations by default.
Documentation-only deprecations may trigger a runtime warning when launched
with [`--pending-deprecation`][] flag (or its alternative,
`NODE_PENDING_DEPRECATION=1` environment variable).

* *Runtime Deprecation* refers to the use of process warnings emitted at
runtime the first time that a deprecated API is used. A command-line
Expand Down Expand Up @@ -593,20 +596,20 @@ Validate that the commit message is properly formatted using
$ git rev-list upstream/master...HEAD | xargs core-validate-commit
```

Optional: When landing your own commits, force push the amended commit to the
branch you used to open the pull request. If your branch is called `bugfix`,
then the command would be `git push --force-with-lease origin master:bugfix`.
When the pull request is closed, this will cause the pull request to
show the purple merged status rather than the red closed status that is
usually used for pull requests that weren't merged.

Time to push it:

```text
$ git push upstream master
```
* Optional: Force push the amended commit to the branch you used to
open the pull request. If your branch is called `bugfix`, then the
command would be `git push --force-with-lease origin master:bugfix`.
When the pull request is closed, this will cause the pull request to
show the purple merged status rather than the red closed status that is
usually used for pull requests that weren't merged. Only do this when
landing your own contributions.

* Close the pull request with a "Landed in `<commit hash>`" comment. If
Close the pull request with a "Landed in `<commit hash>`" comment. If
your pull request shows the purple merged status then you should still
add the "Landed in <commit hash>..<commit hash>" comment if you added
multiple commits.
Expand Down Expand Up @@ -744,6 +747,7 @@ LTS working group and the Release team.
[backporting guide]: doc/guides/backporting-to-release-lines.md
[Stability Index]: doc/api/documentation.md#stability-index
[Enhancement Proposal]: https://github.com/nodejs/node-eps
[`--pending-deprecation`]: doc/api/cli.md#--pending-deprecation
[git-username]: https://help.github.com/articles/setting-your-username-in-git/
[`node-core-utils`]: https://github.com/nodejs/node-core-utils
[TSC]: https://github.com/nodejs/TSC
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ doc-only: $(apidoc_dirs) $(apiassets) ## Builds the docs with the local or the
if [ ! -d doc/api/assets ]; then \
$(MAKE) tools/doc/node_modules/js-yaml/package.json; \
fi;
@$(MAKE) -s $(apidocs_html) $(apidocs_json)
@$(MAKE) $(apidocs_html) $(apidocs_json)

.PHONY: doc
doc: $(NODE_EXE) doc-only
Expand Down Expand Up @@ -1183,6 +1183,7 @@ lint: ## Run JS, C++, MD and doc linters.
$(MAKE) lint-js || EXIT_STATUS=$$? ; \
$(MAKE) lint-cpp || EXIT_STATUS=$$? ; \
$(MAKE) lint-addon-docs || EXIT_STATUS=$$? ; \
$(MAKE) lint-md || EXIT_STATUS=$$? ; \
exit $$EXIT_STATUS
CONFLICT_RE=^>>>>>>> [0-9A-Fa-f]+|^<<<<<<< [A-Za-z]+

Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
<a title="CII Best Practices" href="https://bestpractices.coreinfrastructure.org/projects/29"><img src="https://bestpractices.coreinfrastructure.org/projects/29/badge"></a>
</p>

Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js
uses an event-driven, non-blocking I/O model that makes it lightweight and
efficient. The Node.js package ecosystem, [npm][], is the largest ecosystem of
open source libraries in the world.
Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. For
more information on using Node.js, see the
[Node.js Website][].

The Node.js project is supported by the
[Node.js Foundation](https://nodejs.org/en/foundation/). Contributions,
Expand Down Expand Up @@ -245,6 +244,8 @@ For more information about the governance of the Node.js project, see
**Franziska Hinkelmann** &lt;franziska.hinkelmann@gmail.com&gt; (she/her)
* [Fishrock123](https://github.com/Fishrock123) -
**Jeremiah Senkpiel** &lt;fishrock123@rocketmail.com&gt;
* [gibfahn](https://github.com/gibfahn) -
**Gibson Fahnestock** &lt;gibfahn@gmail.com&gt; (he/him)
* [indutny](https://github.com/indutny) -
**Fedor Indutny** &lt;fedor.indutny@gmail.com&gt;
* [jasnell](https://github.com/jasnell) -
Expand All @@ -255,8 +256,6 @@ For more information about the governance of the Node.js project, see
**Matteo Collina** &lt;matteo.collina@gmail.com&gt; (he/him)
* [mhdawson](https://github.com/mhdawson) -
**Michael Dawson** &lt;michael_dawson@ca.ibm.com&gt; (he/him)
* [mscdex](https://github.com/mscdex) -
**Brian White** &lt;mscdex@mscdex.net&gt;
* [MylesBorins](https://github.com/MylesBorins) -
**Myles Borins** &lt;myles.borins@gmail.com&gt; (he/him)
* [ofrobots](https://github.com/ofrobots) -
Expand All @@ -282,6 +281,8 @@ For more information about the governance of the Node.js project, see
**Isaac Z. Schlueter** &lt;i@izs.me&gt;
* [joshgav](https://github.com/joshgav) -
**Josh Gavant** &lt;josh.gavant@outlook.com&gt;
* [mscdex](https://github.com/mscdex) -
**Brian White** &lt;mscdex@mscdex.net&gt;
* [nebrius](https://github.com/nebrius) -
**Bryan Hughes** &lt;bryan@nebri.us&gt;
* [orangemocha](https://github.com/orangemocha) -
Expand Down Expand Up @@ -339,6 +340,8 @@ For more information about the governance of the Node.js project, see
**Daniel Bevenius** &lt;daniel.bevenius@gmail.com&gt;
* [DavidCai1993](https://github.com/DavidCai1993) -
**David Cai** &lt;davidcai1993@yahoo.com&gt; (he/him)
* [devsnek](https://github.com/devsnek) -
**Gus Caplan** &lt;me@gus.host&gt; (he/him)
* [edsadr](https://github.com/edsadr) -
**Adrian Estrada** &lt;edsadr@gmail.com&gt; (he/him)
* [eljefedelrodeodeljefe](https://github.com/eljefedelrodeodeljefe) -
Expand Down Expand Up @@ -590,12 +593,13 @@ Previous releases may also have been signed with one of the following GPG keys:

* [Contributing to the project][]
* [Working Groups][]
* [Strategic Initiatives][]

[npm]: https://www.npmjs.com
[Code of Conduct]: https://github.com/nodejs/admin/blob/master/CODE_OF_CONDUCT.md
[Contributing to the project]: CONTRIBUTING.md
[Node.js Help]: https://github.com/nodejs/help
[Node.js Website]: https://nodejs.org/en/
[Questions tagged 'node.js' on StackOverflow]: https://stackoverflow.com/questions/tagged/node.js
[Working Groups]: https://github.com/nodejs/TSC/blob/master/WORKING_GROUPS.md
[Strategic Initiatives]: https://github.com/nodejs/TSC/blob/master/Strategic-Initiatives.md
[#node.js channel on chat.freenode.net]: https://webchat.freenode.net?channels=node.js&uio=d4
2 changes: 1 addition & 1 deletion benchmark/_http-benchmarkers.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ exports.run = function(options, callback) {
port: exports.PORT,
path: '/',
connections: 100,
duration: 10,
duration: 5,
benchmarker: exports.default_http_benchmarker
}, options);
if (!options.benchmarker) {
Expand Down
45 changes: 8 additions & 37 deletions benchmark/assert/deepequal-buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ const bench = common.createBenchmark(main, {
});

function main({ len, n, method }) {
var i;

const data = Buffer.allocUnsafe(len + 1);
const actual = Buffer.alloc(len);
const expected = Buffer.alloc(len);
Expand All @@ -24,40 +22,13 @@ function main({ len, n, method }) {
data.copy(expected);
data.copy(expectedWrong);

switch (method) {
case '':
// Empty string falls through to next line as default, mostly for tests.
case 'deepEqual':
bench.start();
for (i = 0; i < n; ++i) {
// eslint-disable-next-line no-restricted-properties
assert.deepEqual(actual, expected);
}
bench.end(n);
break;
case 'deepStrictEqual':
bench.start();
for (i = 0; i < n; ++i) {
assert.deepStrictEqual(actual, expected);
}
bench.end(n);
break;
case 'notDeepEqual':
bench.start();
for (i = 0; i < n; ++i) {
// eslint-disable-next-line no-restricted-properties
assert.notDeepEqual(actual, expectedWrong);
}
bench.end(n);
break;
case 'notDeepStrictEqual':
bench.start();
for (i = 0; i < n; ++i) {
assert.notDeepStrictEqual(actual, expectedWrong);
}
bench.end(n);
break;
default:
throw new Error('Unsupported method');
// eslint-disable-next-line no-restricted-properties
const fn = method !== '' ? assert[method] : assert.deepEqual;
const value2 = method.includes('not') ? expectedWrong : expected;

bench.start();
for (var i = 0; i < n; ++i) {
fn(actual, value2);
}
bench.end(n);
}
2 changes: 1 addition & 1 deletion benchmark/assert/deepequal-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,6 @@ function main({ n, len, method }) {
benchmark(assert.notDeepEqual, n, values, values2);
break;
default:
throw new Error('Unsupported method');
throw new Error(`Unsupported method ${method}`);
}
}
44 changes: 8 additions & 36 deletions benchmark/assert/deepequal-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,47 +28,19 @@ function createObj(source, add = '') {
function main({ size, n, method }) {
// TODO: Fix this "hack". `n` should not be manipulated.
n = n / size;
var i;

const source = Array.apply(null, Array(size));
const actual = createObj(source);
const expected = createObj(source);
const expectedWrong = createObj(source, '4');

switch (method) {
case '':
// Empty string falls through to next line as default, mostly for tests.
case 'deepEqual':
bench.start();
for (i = 0; i < n; ++i) {
// eslint-disable-next-line no-restricted-properties
assert.deepEqual(actual, expected);
}
bench.end(n);
break;
case 'deepStrictEqual':
bench.start();
for (i = 0; i < n; ++i) {
assert.deepStrictEqual(actual, expected);
}
bench.end(n);
break;
case 'notDeepEqual':
bench.start();
for (i = 0; i < n; ++i) {
// eslint-disable-next-line no-restricted-properties
assert.notDeepEqual(actual, expectedWrong);
}
bench.end(n);
break;
case 'notDeepStrictEqual':
bench.start();
for (i = 0; i < n; ++i) {
assert.notDeepStrictEqual(actual, expectedWrong);
}
bench.end(n);
break;
default:
throw new Error('Unsupported method');
// eslint-disable-next-line no-restricted-properties
const fn = method !== '' ? assert[method] : assert.deepEqual;
const value2 = method.includes('not') ? expectedWrong : expected;

bench.start();
for (var i = 0; i < n; ++i) {
fn(actual, value2);
}
bench.end(n);
}
69 changes: 22 additions & 47 deletions benchmark/assert/deepequal-prims-and-objs-big-array-set.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,19 @@ const bench = common.createBenchmark(main, {
]
});

function run(fn, n, actual, expected) {
bench.start();
for (var i = 0; i < n; ++i) {
fn(actual, expected);
}
bench.end(n);
}

function main({ n, len, primitive, method }) {
const prim = primValues[primitive];
const actual = [];
const expected = [];
const expectedWrong = [];
var i;

for (var x = 0; x < len; x++) {
actual.push(prim);
Expand All @@ -51,69 +58,37 @@ function main({ n, len, primitive, method }) {
const expectedWrongSet = new Set(expectedWrong);

switch (method) {
// Empty string falls through to next line as default, mostly for tests.
case '':
// Empty string falls through to next line as default, mostly for tests.
case 'deepEqual_Array':
bench.start();
for (i = 0; i < n; ++i) {
// eslint-disable-next-line no-restricted-properties
assert.deepEqual(actual, expected);
}
bench.end(n);
// eslint-disable-next-line no-restricted-properties
run(assert.deepEqual, n, actual, expected);
break;
case 'deepStrictEqual_Array':
bench.start();
for (i = 0; i < n; ++i) {
assert.deepStrictEqual(actual, expected);
}
bench.end(n);
run(assert.deepStrictEqual, n, actual, expected);
break;
case 'notDeepEqual_Array':
bench.start();
for (i = 0; i < n; ++i) {
// eslint-disable-next-line no-restricted-properties
assert.notDeepEqual(actual, expectedWrong);
}
bench.end(n);
// eslint-disable-next-line no-restricted-properties
run(assert.notDeepEqual, n, actual, expectedWrong);
break;
case 'notDeepStrictEqual_Array':
bench.start();
for (i = 0; i < n; ++i) {
assert.notDeepStrictEqual(actual, expectedWrong);
}
bench.end(n);
run(assert.notDeepStrictEqual, n, actual, expectedWrong);
break;
case 'deepEqual_Set':
bench.start();
for (i = 0; i < n; ++i) {
// eslint-disable-next-line no-restricted-properties
assert.deepEqual(actualSet, expectedSet);
}
bench.end(n);
// eslint-disable-next-line no-restricted-properties
run(assert.deepEqual, n, actualSet, expectedSet);
break;
case 'deepStrictEqual_Set':
bench.start();
for (i = 0; i < n; ++i) {
assert.deepStrictEqual(actualSet, expectedSet);
}
bench.end(n);
run(assert.deepStrictEqual, n, actualSet, expectedSet);
break;
case 'notDeepEqual_Set':
bench.start();
for (i = 0; i < n; ++i) {
// eslint-disable-next-line no-restricted-properties
assert.notDeepEqual(actualSet, expectedWrongSet);
}
bench.end(n);
// eslint-disable-next-line no-restricted-properties
run(assert.notDeepEqual, n, actualSet, expectedWrongSet);
break;
case 'notDeepStrictEqual_Set':
bench.start();
for (i = 0; i < n; ++i) {
assert.notDeepStrictEqual(actualSet, expectedWrongSet);
}
bench.end(n);
run(assert.notDeepStrictEqual, n, actualSet, expectedWrongSet);
break;
default:
throw new Error('Unsupported method');
throw new Error(`Unsupported method "${method}"`);
}
}
Loading