Joyee Cheung
34bf31ea8a
util: improve readability of normalizeEncoding
...
* Improve readability of util.normalizeEncoding
and add some comments
* Add a benchmark for util.normalizeEncoding
PR-URL: https://github.com/nodejs/node/pull/10439
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Andreas Madsen <amwebdk@gmail.com >
2017-01-15 20:30:51 +08:00
Joyee Cheung
d4b749b62f
benchmark: improve WHATWG URL benchmarks
...
* add benchmark to compare the performance of getting url
properties between the WHATWG URL and the legacy implementation
* add benchmark to compare the performance of serializing urls
between the WHATWG URL and the legacy implementation
* refactor the benchmark for comparing parsing performance
between the two implementations
PR-URL: https://github.com/nodejs/node/pull/10678
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
2017-01-15 20:26:19 +08:00
Rich Trott
97f001ab16
test,net: add tests for server.connections
...
There were no tests confirming situations where server.connections
should return `null`. Add a test for that situation.
Expand existing server.connection test slightly to check value.
Refactor (mostly spacing) code for server.connections setter.
PR-URL: https://github.com/nodejs/node/pull/10762
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-01-14 20:57:26 -08:00
Sakthipriyan Vairamani (thefourtheye)
66f09be743
Revert "fs: ensure readFile[Sync] reads from the beginning"
...
This reverts commit 4444e731f2 .
PR-URL: https://github.com/nodejs/node/pull/10809
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2017-01-14 20:50:43 +01:00
Nikolai Vavilov
4444e731f2
fs: ensure readFile[Sync] reads from the beginning
...
It would previously read from the current file position, which can be
non-zero if the `fd` has been read from or written to. This contradicts
the documentation which states that it "reads the entire contents of a
file".
PR-URL: https://github.com/nodejs/node/pull/9699
Fixes: https://github.com/nodejs/node/issues/9671
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
2017-01-14 20:33:18 +02:00
Joyee Cheung
f18b4632b9
benchmark: use "confidence" in output of compare.R
...
Use the word "confidence" to indicate the confidence level of
the p value so it's easier to understand.
With this change more stars in the output of compare.R means
higher confidence level (lower significance level).
PR-URL: https://github.com/nodejs/node/pull/10737
Refs: https://github.com/nodejs/node/pull/10439
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Andreas Madsen <amwebdk@gmail.com >
2017-01-14 14:57:07 +08:00
cjihrig
2f885e7a43
cluster: refactor module into multiple files
...
This commit splits the existing cluster module into several
internal modules. More specifically, the cluster master and
worker implementations are separated, and the various data
structures are separated.
PR-URL: https://github.com/nodejs/node/pull/10746
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
2017-01-13 17:01:07 -05:00
Brian White
57e2ec4356
test: add http.ClientRequest defaults test
...
PR-URL: https://github.com/nodejs/node/pull/10654
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com >
2017-01-13 16:11:19 -05:00
Brian White
c5d0fd9641
benchmark: add ClientRequest creation benchmark
...
PR-URL: https://github.com/nodejs/node/pull/10654
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com >
2017-01-13 16:11:19 -05:00
Brian White
2f7759640e
http: misc ClientRequest cleanup
...
PR-URL: https://github.com/nodejs/node/pull/10654
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com >
2017-01-13 16:11:18 -05:00
Brian White
15c6187aa5
http: avoid duplicate isArray()
...
PR-URL: https://github.com/nodejs/node/pull/10654
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com >
2017-01-13 16:11:18 -05:00
Brian White
dab22b5b7a
http: optimize default method case
...
PR-URL: https://github.com/nodejs/node/pull/10654
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com >
2017-01-13 16:11:18 -05:00
Brian White
5c2ef14f21
http: optimize short path validation
...
PR-URL: https://github.com/nodejs/node/pull/10654
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com >
2017-01-13 16:11:17 -05:00
Irene Li
6782577eef
test: check error msg test-writeint.js
...
PR-URL: https://github.com/nodejs/node/pull/10755
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-01-13 15:36:03 -05:00
Rich Trott
20efbffaf8
lib: refactor bootstrap_node.js regular expression
...
* use `+` instead of `*` where one-or-more is required
* switch from String.prototype.match() to RegExp.prototype.test()
PR-URL: https://github.com/nodejs/node/pull/10749
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: Jackson Tian <shyvo1987@gmail.com >
2017-01-13 10:10:21 -08:00
Javis Sullivan
4424e847d5
doc: remove duplicate properties bullet in readme
...
PR-URL: https://github.com/nodejs/node/pull/10741
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2017-01-13 09:53:53 -08:00
istinson
19917ee402
test: no unused args test-fs-watch-file.js
...
PR-URL: https://github.com/nodejs/node/pull/10758
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2017-01-13 09:32:57 -08:00
Adrian Estrada
5520e40af3
test: improve the code in test-crypto-dh
...
* validate the errors for all assert.throws
* use arrow functions
PR-URL: https://github.com/nodejs/node/pull/10734
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2017-01-13 09:28:20 -08:00
Chase Starr
a2af61afc6
test: improve tests in pummel/test-exec
...
* add asset.strictEqual to stdout and stderr. Fixes no-unused-vars.
* replace double quotes with single
PR-URL: https://github.com/nodejs/node/pull/10757
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2017-01-13 09:24:22 -08:00
Jackson Tian
dad98bfe32
readline: refactor construct Interface
...
Remove the dependency on the arguments.length.
PR-URL: https://github.com/nodejs/node/pull/4740
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Trevor Norris <trev.norris@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2017-01-13 22:49:35 +08:00
Gibson Fahnestock
57f6a106fb
test: fix temp-dir option in tools/test.py
...
If a temp-dir is specified and already exists, the NODE_TEST_DIR
environment variable will never be set. This fixes that.
PR-URL: https://github.com/nodejs/node/pull/10723
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2017-01-12 13:32:02 -08:00
Gibson Fahnestock
dd2d3d3f9d
test: use realpath for NODE_TEST_DIR in common.js
...
If you don't specify NODE_TEST_DIR, common.tmpDir will resolve to the
realpath of `node/test`.
If you do specify NODE_TEST_DIR (with the environment variable or by
running or by running tools/test.py --test-dir=x), common.tmpDir (which
is resolved from testRoot) uses the symbolic path (doesn't resolve
symlinks). This uses fs.realpathSync() to fix that.
PR-URL: https://github.com/nodejs/node/pull/10723
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2017-01-12 13:32:02 -08:00
Sam Roberts
822bbe0bb2
test: fix linting for test-tls-add-ca-cert.js
...
Fix lint error introduced in ea72331af
PR-URL: https://github.com/nodejs/node/pull/10771
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2017-01-12 13:29:50 -08:00
Sam Roberts
0c8cfd4eca
eslint: remove dangling eslint symlink
...
Reapplication of https://github.com/nodejs/node/pull/9299 since the
symlink was re-added in f44969a5a .
PR-URL: https://github.com/nodejs/node/pull/10771
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2017-01-12 13:29:36 -08:00
Sam Roberts
9271a412b9
test: getgroups() may contain duplicate GIDs
...
Some systems may have multiple group names with the same group ID, in
which case getgroups() returns duplicate values, where `id -G` will
filter the duplicates. Unique and sort the arrays so they can be
compared.
PR-URL: https://github.com/nodejs/node/pull/10389
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2017-01-12 11:10:52 -08:00
Sam Roberts
84a23c7205
doc,test: tls .ca option supports multi-PEM files
...
PR-URL: https://github.com/nodejs/node/pull/10389
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2017-01-12 11:10:46 -08:00
Sam Roberts
733c4a813b
test: tls cert chain completion scenarios
...
PR-URL: https://github.com/nodejs/node/pull/10389
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2017-01-12 11:10:41 -08:00
Sam Roberts
f9665280a4
doc: use correct tls certificate property name
...
Docs referred to an `issuer` property being optionally present, when it
should have referred to the `issuerCertificate` property.
PR-URL: https://github.com/nodejs/node/pull/10389
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2017-01-12 11:10:32 -08:00
Sam Roberts
ea72331afc
test: check tls server verification with addCACert
...
SecureContext.addCACert() adds to the existing root store,
preserving root cert entries. option.ca is applied without
calling SecureContext.addRootCerts() so should add to
the default, empty, root store.
This test confirms that the built-in root CAs are not included
when options.ca is used.
Based on:
https://github.com/shigeki/node/commit/acd5837fd737351dd953b0387695705067cd69cb
PR-URL: https://github.com/nodejs/node/pull/10389
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2017-01-12 11:10:20 -08:00
Sam Roberts
99b0c2e7a7
test: move common tls connect setup into fixtures
...
TLS connection setup boilerplate is common to many TLS tests, factor it
into a test fixture so tests are clearer to read and faster to write.
PR-URL: https://github.com/nodejs/node/pull/10389
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2017-01-12 11:10:03 -08:00
Nathan Phillip Brink
7f20c8a3d4
doc: update writable.write return value
...
Fix the explanation which stated that write() would return false if
highWaterMark is exceeded to correctly state that false is returned
once highWaterMark is reached. See #9247 .
PR-URL: https://github.com/nodejs/node/pull/10582
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2017-01-12 18:49:05 +01:00
Brian White
c001d2aab5
benchmark: don't lint autogenerated modules
...
PR-URL: https://github.com/nodejs/node/pull/10756
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Teddy Katz <teddy.katz@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-01-12 08:13:54 -08:00
Adrian Estrada
537d7bd936
test: improve test stream transform constructor
...
* new test for the error when a transform function is not specified
* use let instead of var
* use assert.strictEqual instead of assert.equal
* use arrow functions
PR-URL: https://github.com/nodejs/node/pull/10699
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-01-12 08:11:49 -08:00
cjihrig
74fb8a2948
deps: upgrade libuv to 1.10.2
...
Refs: https://github.com/nodejs/node/issues/9439
Fixes: https://github.com/nodejs/node/issues/9464
Fixes: https://github.com/nodejs/node/issues/9690
PR-URL: https://github.com/nodejs/node/pull/10717
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com >
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com >
2017-01-12 10:26:43 -05:00
Rich Trott
d3eca02576
test: move resource intensive test to sequential
...
test-fs-readfile-tostring-fail is resource-intensive and is flaky in
CI. Move to sequential tests so it is not competing for resources with
other tests.
PR-URL: https://github.com/nodejs/node/pull/10744
Fixes: https://github.com/nodejs/node/issues/10742
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com >
2017-01-11 17:18:13 -08:00
Alexey Orlenko
d85d120593
src: enable writev for pipe handles on Unix
...
This commit enables writev for Unix Domain Sockets on supported
platforms thus enabling cork/uncork functionality for them and
improving IPC performance.
Fixes: https://github.com/nodejs/node/issues/5095
PR-URL: https://github.com/nodejs/node/pull/10677
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com >
Reviewed-By: Trevor Norris <trev.norris@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-01-11 16:32:44 -08:00
Rich Trott
0674789f36
doc: edit writing-tests.md
...
* Remove passive voice
* Remove unneeded modifiers
* Minor comma change
PR-URL: https://github.com/nodejs/node/pull/10585
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: Italo A. Casas <me@italoacasas.com >
2017-01-11 16:03:55 -08:00
Alexey Orlenko
8781e61843
doc: fix misleading language in vm docs
...
The note following the http.Server example in the vm documentation
contains misleading language. This commit removes the incorrect
reference to threads.
Fixes: https://github.com/nodejs/node/issues/10697
PR-URL: https://github.com/nodejs/node/pull/10708
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-01-11 18:12:43 -05:00
larissayvette
c8ed5f29ca
test: add test for noAssert option in buf.read*()
...
PR-URL: https://github.com/nodejs/node/pull/10713
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-01-11 14:57:13 -08:00
Brian White
03b9f6fe26
stream: avoid instanceof
...
PR-URL: https://github.com/nodejs/node/pull/10558
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
2017-01-11 12:55:04 -05:00
Brian White
a3539ae3be
stream: use plain objects for write/corked reqs
...
This is similar to a change made awhile back for storing
process.nextTick() requests.
PR-URL: https://github.com/nodejs/node/pull/10558
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
2017-01-11 12:54:59 -05:00
Brian White
b888bfe81d
benchmark: allow zero when parsing http req/s
...
Without this, the http benchmarker would report "strange output" if
wrk or any other http client reported 0 requests per second, which is
a valid result.
PR-URL: https://github.com/nodejs/node/pull/10558
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
2017-01-11 12:54:49 -05:00
Brian White
176cdc2823
http: misc optimizations and style fixes
...
PR-URL: https://github.com/nodejs/node/pull/10558
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
2017-01-11 12:54:45 -05:00
Brian White
73d9445782
http: try to avoid lowercasing incoming headers
...
PR-URL: https://github.com/nodejs/node/pull/10558
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
2017-01-11 12:54:41 -05:00
Brian White
c77ed327d9
http: avoid using object for removed header status
...
PR-URL: https://github.com/nodejs/node/pull/10558
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
2017-01-11 12:54:36 -05:00
Brian White
c00e4adbb4
http: optimize header storage and matching
...
This commit implements two optimizations when working with headers:
* Avoid having to explicitly "render" headers and separately store the
original casing for header names.
* Match special header names using a single regular expression instead
of testing one regular expression per header name.
PR-URL: https://github.com/nodejs/node/pull/10558
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
2017-01-11 12:54:31 -05:00
Brian White
ec8910bcea
http: check statusCode early
...
By enforcing the statusCode to be an SMI, it helps a bit
performance-wise when looking up the associated statusMessage.
PR-URL: https://github.com/nodejs/node/pull/10558
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
2017-01-11 12:54:26 -05:00
Brian White
f53a6fb48b
benchmark: add http header setting scenarios
...
PR-URL: https://github.com/nodejs/node/pull/10558
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
2017-01-11 12:52:57 -05:00
Anna Henningsen
fa3836152d
doc: mention cc-ing nodejs/url team for reviews
...
Add the nodejs/url github team to the table of people to /cc for
reviews on the WHATWG URL code.
PR-URL: https://github.com/nodejs/node/pull/10652
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
2017-01-11 09:23:12 -08:00
Sam Roberts
02b9270444
doc: sort require statements in tests
...
PR-URL: https://github.com/nodejs/node/pull/10616
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com >
2017-01-11 09:04:04 -08:00