0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

16018 Commits

Author SHA1 Message Date
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
Matteo Collina
e9044c83a9 doc: handle backpressure when write() return false
The doc specified that writable.write() was advisory only. However,
ignoring that value might lead to memory leaks. This PR specifies that
behavior. Moreover, it adds an example on how to listen for the 'drain'
event correctly.

See: f347dad0b7
PR-URL: https://github.com/nodejs/node/pull/10631
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-01-11 17:28:09 +01:00
Gibson Fahnestock
6509d747ee assert, tools: enforce strict (not)equal in eslint
Extend no-restricted-properties to catch use of assert.equal() and
assert.notEqual() and require assert.strictEqual() or
assert.notStrictEqual() instead.

Also update the eslint-ignore in lib/assert.js to avoid
assert.equal/notEqual linter errors in their definitions.

PR-URL: https://github.com/nodejs/node/pull/10698
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: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
2017-01-11 14:19:29 +00:00
Gibson Fahnestock
3d2aef3979 test: s/assert.equal/assert.strictEqual/
Use assert.strictEqual instead of assert.equal in tests, manually
convert types where necessary.

PR-URL: https://github.com/nodejs/node/pull/10698
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: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
2017-01-11 14:19:26 +00:00
Gibson Fahnestock
81fef918d5 tools, test: require const/let in test
PR-URL: https://github.com/nodejs/node/pull/10685
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2017-01-11 11:52:01 +00:00
Gibson Fahnestock
7a0e462f9f test: use eslint to fix var->const/let
Manually fix issues that eslint --fix couldn't do automatically.

PR-URL: https://github.com/nodejs/node/pull/10685
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2017-01-11 11:43:52 +00:00
Kirill Fomichev
1ef401ce92 crypto: use check macros in CipherBase::SetAuthTag
PR-URL: https://github.com/nodejs/node/pull/9395
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-01-10 17:32:51 -08:00
Andreas Lind
a469f85653 https: Use secureProtocol in Agent#getName
Refs: https://github.com/nodejs/node/issues/9324
PR-URL: https://github.com/nodejs/node/pull/9452
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-01-10 17:12:30 -08:00
abouthiroppy
da96843920 test: refactor cluster-preload.js
PR-URL: https://github.com/nodejs/node/pull/10701
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
2017-01-10 16:57:48 -05:00
Rich Trott
eb0df4a9b9 doc: add test naming information to guide
The guide for writing tests is missing information on how tests are
named. This adds that information.

There is also some copy-editing done on the first paragraph of the
guide.

PR-URL: https://github.com/nodejs/node/pull/10584
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2017-01-10 13:13:59 -08:00
Johannes Rieken
4e8eb628c1 doc: fix missing negation in stream.md
Changing `..can result in expected` to `..can result in unexpected`

Fixes: https://github.com/nodejs/node/issues/10710
PR-URL: https://github.com/nodejs/node/pull/10712
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-01-10 13:08:20 -08:00
adelmann
596d86fc3d test: refactor test-crypto-padding-aes256
* replace var with const/let
* replace assert.equal() with assert.strictEqual()

PR-URL: https://github.com/nodejs/node/pull/10622
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-01-10 13:04:38 -08:00
Anna Henningsen
627ecee9ed child_process: support Uint8Array input to methods
Support `Uint8Array` input to all the synchronous methods.

PR-URL: https://github.com/nodejs/node/pull/10653
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michal Zasso <targos@protonmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-01-10 11:35:45 -08:00
Myles Borins
db14687dec doc: "s/git apply/git am -3" in V8 guide
git apply does not preserve the original commit message. These updated
instructions offer a simpler flow for backporting.

PR-URL: https://github.com/nodejs/node/pull/10665
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Michal Zasso <targos@protonmail.com>
2017-01-10 11:28:25 -08:00
sivaprasanna
aacd323ff3 test: refactor the code of test-keep-alive.js
* use const and let instead of var
* use assert.strictEqual instead of assert.equal
* use arrow functions
* removed console.log statements

PR-URL: https://github.com/nodejs/node/pull/10684
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-01-10 11:14:24 -08:00
cjihrig
2d2a059827 test: refactor test-http-mutable-headers.js
PR-URL: https://github.com/nodejs/node/pull/10664
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-01-10 14:03:45 -05:00
cjihrig
a73ab9de0d http: remove pointless use of arguments
PR-URL: https://github.com/nodejs/node/pull/10664
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-01-10 14:03:45 -05:00
Rich Trott
022b53c9de lib: refactor crypto cipher/hash/curve getters
* refactor internal util.filterDuplicateStrings() to eliminate unused
  code paths
* `.indexOf()` -> `.includes()` in test
* more concise arrow functions

PR-URL: https://github.com/nodejs/node/pull/10682
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michal Zasso <targos@protonmail.com>
2017-01-10 10:48:59 -08:00
Evan Lucas
f1253e8627 doc: update LTS info for current releases
The COLLABORATOR_GUIDE was still listing v0.10 and v0.12 as LTS when
they are EOL now.

PR-URL: https://github.com/nodejs/node/pull/10720
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-01-10 12:32:26 -06:00
Jonathan Boarman
ed9b6c1264 doc: correct vcbuild options for windows testing
Corrected parameter for running tests on Windows. Without the corrected
parameters, Windows users encounter an error about failing to sign the
build, "Failed to sign exe", which can be discouraging to new Windows
community members.

PR-URL: https://github.com/nodejs/node/pull/10686
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
2017-01-10 10:11:24 -08:00
Nathan Friedly
762a303e1f test: validate 'expected' argument to mustCall()
instead of silently overwriting invalid values with the default

PR-URL: https://github.com/nodejs/node/pull/10692
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michal Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-01-10 09:23:36 -08:00
Nathan Friedly
005213b43d test: fix misplaced ) in http response statuscode test
This fixes a misplaced parenthesis in each of the tests in
test/parallel/test-http-response-statuscodes.js, causing the tests to
pass as long as any error was thrown, without validating the error
message.

PR-URL: https://github.com/nodejs/node/pull/10692
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michal Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-01-10 09:22:59 -08:00
abouthiroppy
c61d9bade0 test: refactor test-doctool-html.js
PR-URL: https://github.com/nodejs/node/pull/10696
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-01-10 09:10:36 -08:00
Adrian Estrada
85a90340e1 test: improve test-crypto-rsa-dsa
* use const and let instead of var
* use assert.strictEqual or assert.strictDeepEqual instead of assert.equal
* use arrow functions
* swap assertions arguments to match the standard
* validate the error for assert.throws

PR-URL: https://github.com/nodejs/node/pull/10681
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-01-10 17:53:16 +01:00
Sam Roberts
5aa210afe6 doc: specify sorted requires in tests
And allow anchor links to the various sections, to more easily reference
them when reviewing PRs.

PR-URL: https://github.com/nodejs/node/pull/10716
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-01-10 07:31:51 -08:00
Nikolai Vavilov
3c2a9361ff fs: remove fs.read's string interface
It is a maintenance burden that was removed from the docs in 2010
(c93e0aaf06) and runtime-deprecated in v6.0
(1124de2d76).

PR-URL: https://github.com/nodejs/node/pull/9683
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2017-01-10 14:26:23 +02:00
Adrian Estrada
2685464e34 test: improve the code in test-process-hrtime
* use const instead of var
* use assert.strictEqual instead of assert.equal and plain assert
* use arrow functions
* swap assertions arguments to match the standard
* validate the error for assert.throws

PR-URL: https://github.com/nodejs/node/pull/10667
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michal Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-01-09 23:50:57 -08:00
Lukasz Gasior
c9b52aad0a doc: update BUILDING.md
Added a note about Visual Studio 2015 feature which should
be installed for building Node.js source code.

PR-URL: https://github.com/nodejs/node/pull/10669
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
2017-01-09 23:28:02 -08:00
Gibson Fahnestock
59a3f868a9 doc: document use of Refs: for references
Standardise on Refs:

PR-URL: https://github.com/nodejs/node/pull/10670
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2017-01-09 23:25:58 -08:00
sivaprasanna
a799854ce9 test: refactor test-watch-file.js
* use const and let instead of var
* use arrow function
* removed console.log statements

PR-URL: https://github.com/nodejs/node/pull/10679
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-01-09 23:21:38 -08:00
vitkarpov
a2ea1344ea
http: define all used properties in constructors
Adding all used properties in the constructor makes the hidden class
stable and heap snapshots more verbose.

Refs: https://github.com/nodejs/node/issues/8912
PR-URL: https://github.com/nodejs/node/pull/9116
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-01-10 01:33:52 -05:00
Rich Trott
3f61521087 test,cluster: add test-cluster-worker-deprecated
Add test to cover setter for deprecated cluster Worker property.
Previously, the setter was not being exercised in tests.

PR-URL: https://github.com/nodejs/node/pull/10675
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2017-01-09 21:46:26 -08:00
Michael Lefkowitz
39c4af580c test: improve zlib-from-gzip-with-trailing-garbage
* use assert.strictEqual instead of assert.equal
* add RegExp in second argument of assert.throws
* validate error message and code

PR-URL: https://github.com/nodejs/node/pull/10674
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-01-09 21:08:41 -08:00
sivaprasanna
41567ee9d8 test: refactor the code in test-child-process-spawn-loop.js
* use const and let instead of var
* use assert.strictEqual instead of assert.equal
* use arrow functions

PR-URL: https://github.com/nodejs/node/pull/10605
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-01-09 09:36:11 -08:00
cjihrig
b9abeeccc0 test: allow testing uid and gid separately
This commit lets the uid and gid options of spawn() to be
tested independently of one another based on the user's uid
and gid.

Fixes: https://github.com/nodejs/node/issues/10646
PR-URL: https://github.com/nodejs/node/pull/10647
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-01-09 12:31:52 -05:00
James M Snell
0f62ee6963 url: allow use of URL with http.request and https.request
PR-URL: https://github.com/nodejs/node/pull/10638
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Michal Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-01-09 09:28:11 -08:00
Adrian Estrada
fd115862f4 test: improve code in test-https-strict
* use let and const instead of var
* use assert.strictEqual instead of assert.equal
* remove unused var

PR-URL: https://github.com/nodejs/node/pull/10648
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-01-09 09:26:18 -08:00
Teddy Katz
5d31448844 tools,test: enforce assert.ifError with lint rule
This adds an ESLint rule to enforce the use of `assert.ifError(err)`
instead of `if (err) throw err;` in tests.

PR-URL: https://github.com/nodejs/node/pull/10671
Ref: https://github.com/nodejs/node/pull/10543
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Michal Zasso <targos@protonmail.com>
2017-01-09 09:20:38 -08:00
cjihrig
775de9cc96 test: improve module version mismatch error check
Refs: https://github.com/nodejs/node/pull/10606
PR-URL: https://github.com/nodejs/node/pull/10636
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-01-09 12:05:02 -05:00
Adrian Estrada
8a12368a20 test: improve test-fs-write-file-sync
* use let and const instead of var
* use assert.strictEqual instead of assert.equal
* swap assertions arguments to match the standard

PR-URL: https://github.com/nodejs/node/pull/10624
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-01-07 18:44:53 +01:00
Adrian Estrada
f895715755 test: improve test-http-chunked-304
* change the nested functions call to run tests in parallel
* use const and let instead of var
* use common.mustCall to control functions execution
* use assert.strictEqual instead of assert.equal
* use arrow functions

PR-URL: https://github.com/nodejs/node/pull/10462
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-01-07 18:38:31 +01:00
Jason Ginchereau
58c38c2d2e src: fix TracingController cleanup
This fixes an incorrect deletion of the `TracingController` instance,
which in some environments could cause an error about an invalid
pointer passed to `free()`. The `TracingController` instance is
actually owned by a `unique_ptr` member of the platform, so calling
`platform::SetTracingController(nullptr)` is the correct way to
delete it. But before that, the `TraceBuffer` must be deleted in
order for the tracing loop to exit; that is accomplished by calling
`TracingController::Initialize(nullptr)`.

PR-URL: https://github.com/nodejs/node/pull/10623
Reviewed-By: Matthew Loring <mattloring@google.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-01-07 13:56:43 +01:00
Adrian Estrada
a5bdcc39ac test: improve test-fs-readfile-zero-byte-liar
* use const instead of var
* use assert.strictEqual instead of assert.equal
* use arrow functions

PR-URL: https://github.com/nodejs/node/pull/10570
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-01-07 12:24:19 +01:00
Junshu Okamoto
377ea285fb test: refactor test-fs-utimes
* favor `===` over `==`
* `var` -> `const`/`let`
* use `common.mustCall()`

PR-URL: https://github.com/nodejs/node/pull/9290
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-01-06 16:11:43 -08:00
Rich Trott
4e5cf85ada tools: add lint rule to enforce timer arguments
Add a custom ESLint rule to require that setTimeout() and setInterval()
get called with at least two arguments. This prevents omitting the
duration or interval.

PR-URL: https://github.com/nodejs/node/pull/9472
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-01-06 15:24:28 -08:00
Rich Trott
6263c00828 test: provide duration/interval to timers
There are places in the code base where setTimeout() or
setInterval() are called with just a callback and no duration/interval.
The timers module will use a value of `1` in that situation.

An unspecified duration or interval can be confusing. Did the original
author forget to provide a value? Did they intend to use setImmediate()
or process.nextTick() instead of setTimeout()? And so on.

This change provides a duration or interval of `1` to all calls in the
codebase where it is missing. `parallel/test-timers.js` still tests the
situation where `setTimeout()` and `setInterval()` are called with
`undefined` and other non-numeric values for the duration/interval.

PR-URL: https://github.com/nodejs/node/pull/9472
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-01-06 15:22:51 -08:00
Rich Trott
38b18e330f tools: remove no-useless-regex-char-class-escape
The `no-useless-regex-char-class-escape` custom lint rule was introduced
as a less aggressive alternative to some enhancements that were
introduced into ESLint. Those enhancements were blocking us from
updating ESLint. However, they have since been relaxed and the custom
rule is no longer needed. Remove it.

PR-URL: https://github.com/nodejs/node/pull/10561
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2017-01-06 14:36:38 -08:00