platform/upstream/nodejs.git
8 years agodoc: fix type references for link gen, link css
Claudio Rodriguez [Tue, 19 Jan 2016 16:03:15 +0000 (13:03 -0300)]
doc: fix type references for link gen, link css

Fixes several type references in the docs so that the
doc html gen tool that parses them can put the correct
links in.

Changes css styling for the generated type links.

PR-URL: https://github.com/nodejs/node/pull/4741
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Chris Dickinson <chris@neversaw.us>
Reviewed-By: Roman Reiss <me@silverwind.io>
8 years agotools: parse types into links in doc html gen
Claudio Rodriguez [Tue, 19 Jan 2016 15:59:55 +0000 (12:59 -0300)]
tools: parse types into links in doc html gen

Changes the parsing of parameter types in the doc html gen
Links to either MDN or nodejs docs depending on type
See #4350

PR-URL: https://github.com/nodejs/node/pull/4741
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Chris Dickinson <chris@neversaw.us>
Reviewed-By: Roman Reiss <me@silverwind.io>
8 years agodoc: multiple improvements in Stream docs
Alexander Makarenko [Tue, 2 Feb 2016 17:34:29 +0000 (20:34 +0300)]
doc: multiple improvements in Stream docs

Add missing links, remove duplicate ones, fix constants and functions styling.
Minor lexical corrections.

PR-URL: https://github.com/nodejs/node/pull/5009
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodoc: fix anchor links from stream to http and events
piepmatz [Sun, 31 Jan 2016 14:44:29 +0000 (15:44 +0100)]
doc: fix anchor links from stream to http and events

PR-URL: https://github.com/nodejs/node/pull/5007
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodoc: replace function expressions with arrows
Benjamin Gruenbaum [Sun, 24 Jan 2016 09:15:51 +0000 (11:15 +0200)]
doc: replace function expressions with arrows

This commit replaces multiple usages of `function(){}` with ES2015
arrow functions in places it was forgotten earlier. The goal is to
make the docs more consistent since other functions were already
replaced with ES2015 arrows.

In addition, it fixes invalid syntax in modules.markdown to valid
syntax as well as remove `var self = this` pattern usages in the code
where they are now possible to avoid through arrow functions.

PR-URL: https://github.com/nodejs/node/pull/4832
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodoc: fix links order in Buffer doc
Alexander Makarenko [Thu, 4 Feb 2016 13:13:43 +0000 (16:13 +0300)]
doc: fix links order in Buffer doc

Sort links in lexical order

PR-URL: https://github.com/nodejs/node/pull/5076
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodoc: clarify optional arguments of Buffer methods
Michaël Zasso [Sun, 31 Jan 2016 15:58:39 +0000 (16:58 +0100)]
doc: clarify optional arguments of Buffer methods

PR-URL: https://github.com/nodejs/node/pull/5008
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
8 years agodoc: improve styling consistency in Buffer docs
Alexander Makarenko [Sun, 31 Jan 2016 13:25:59 +0000 (16:25 +0300)]
doc: improve styling consistency in Buffer docs

Add links style consistency.

PR-URL: https://github.com/nodejs/node/pull/5001
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodoc: make buffer methods styles consistent
Timothy Gu [Tue, 26 Jan 2016 03:05:43 +0000 (19:05 -0800)]
doc: make buffer methods styles consistent

- Maintain alphabetical order
- Add documentation for `offset` and `value` where absent
- Add return value documentation where absent
- Remove redundant "Optional"
- Move defaults to parameter enumerations

PR-URL: https://github.com/nodejs/node/pull/4873
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodoc: fix nonsensical grammar in Buffer::write
Jimb Esser [Mon, 25 Jan 2016 20:45:02 +0000 (12:45 -0800)]
doc: fix nonsensical grammar in Buffer::write

PR-URL: https://github.com/nodejs/node/pull/4863
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
8 years agodoc: fix named anchors in addons.markdown and http.markdown
Michael Theriot [Fri, 15 Jan 2016 05:56:17 +0000 (23:56 -0600)]
doc: fix named anchors in addons.markdown and http.markdown

PR-URL: https://github.com/nodejs/node/pull/4708
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodoc: add buf.indexOf encoding param with example
Karl Skomski [Thu, 21 Jan 2016 16:53:47 +0000 (17:53 +0100)]
doc: add buf.indexOf encoding param with example

PR-URL: https://github.com/nodejs/node/pull/3373
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
8 years agodoc: fenced all code blocks, typo fixes
Robert Jefe Lindstaedt [Sun, 17 Jan 2016 17:39:07 +0000 (18:39 +0100)]
doc: fenced all code blocks, typo fixes

This changes the code blocks from 4-space indentation to ``` fences for
better syntax highlighting and future linting support. Minor On-the-fly
changes for typos and highlight breaking markdown have been made.

JSON-Style objects have been changed so their closing bracket is
on the same line as the opening one.

Known issues:
* Not every JSON / object notation has been improved. Should
  make another run for this.
* Some example functions break hightlighting due to various
  combinations of brackets. However changing them means leaving
  the code style.

Fixes: https://github.com/nodejs/node/issues/4726
PR-URL: https://github.com/nodejs/node/pull/4733
Reviewed-By: Roman Reiss <me@silverwind.io>
8 years agosrc: force line buffering for stderr
Rich Trott [Fri, 6 Nov 2015 22:15:18 +0000 (14:15 -0800)]
src: force line buffering for stderr

SmartOS does not line buffer stderr by default, or at least that is the
behavior on the Node project Jenkins server. Force line buffering. This
resolves the flakiness observed on SmartOS for
test-debug-signal-cluster.

PR-URL: https://github.com/nodejs/node/pull/3701
Fixes: https://github.com/nodejs/node/issues/2476
Refs: https://github.com/nodejs/node/pull/3615
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
8 years agodoc: make references clickable
Roman Klauke [Tue, 12 Jan 2016 21:34:47 +0000 (22:34 +0100)]
doc: make references clickable

The child_process docs contained some links, but some links were
somehow "broken". `make doc` couldn't translate them and left `[]`
in the compiled HTML.

PR-URL: https://github.com/nodejs/node/pull/4654
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodoc: improve child_process.execFile() code example
Ryan Sobol [Thu, 31 Dec 2015 19:14:58 +0000 (11:14 -0800)]
doc: improve child_process.execFile() code example

PR-URL: https://github.com/nodejs/node/pull/4504
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
8 years agodoc: remove "above" and "below" references
Richard Sun [Tue, 5 Jan 2016 10:49:54 +0000 (02:49 -0800)]
doc: remove "above" and "below" references

The docs were recently refactored, and some "above" and "below"
references were no longer accurate. This commit removes many
such references, and replaces others with links.

PR-URL: https://github.com/nodejs/node/pull/4499
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodoc: fix heading level error in Buffer doc
Shigeki Ohtsu [Tue, 5 Jan 2016 09:07:09 +0000 (18:07 +0900)]
doc: fix heading level error in Buffer doc

tools/doc/html.js in make doc throws an error in checking a heading
level in the markdown file.

PR-URL: https://github.com/nodejs/node/pull/4537
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotools: fix warning in doc parsing
Shigeki Ohtsu [Tue, 5 Jan 2016 09:11:19 +0000 (18:11 +0900)]
tools: fix warning in doc parsing

The description of "[start[, end]]" in the doc shows warning of
"invalid param" when parsing an optional parameter in the section.
This fixes insufficient trimming of right square brackets.

PR-URL: https://github.com/nodejs/node/pull/4537
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodoc: improvements to crypto.markdown copy
James M Snell [Sun, 27 Dec 2015 04:54:01 +0000 (20:54 -0800)]
doc: improvements to crypto.markdown copy

General improvements to crypto.markdown including new and
revised examples.

PR-URL: https://github.com/nodejs/node/pull/4435
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
8 years agodoc: improve child_process.markdown copy
James M Snell [Mon, 21 Dec 2015 21:48:43 +0000 (13:48 -0800)]
doc: improve child_process.markdown copy

General improvements to child_process.markdown

PR-URL: https://github.com/nodejs/node/pull/4383
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
8 years agodoc: improvements to buffer.markdown copy
James M Snell [Sun, 20 Dec 2015 16:57:03 +0000 (08:57 -0800)]
doc: improvements to buffer.markdown copy

General improvements to buffer.markdown including new examples,
a few fixes to existing examples, consistent formatting and
others

PR-URL: https://github.com/nodejs/node/pull/4370
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
8 years agodoc: improve addons.markdown copy
James M Snell [Thu, 17 Dec 2015 00:47:37 +0000 (16:47 -0800)]
doc: improve addons.markdown copy

General improvements to the documentation in addons.markdown.

PR-URL: https://github.com/nodejs/node/pull/4320
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
8 years agodeps: upgrade to npm 2.14.19
Kat Marchán [Fri, 19 Feb 2016 23:49:58 +0000 (15:49 -0800)]
deps: upgrade to npm 2.14.19

PR-URL: https://github.com/nodejs/node/pull/5335
Reviewed-By: Myles Borins <mborins@us.ibm.com>
8 years agodeps: upgrade to npm 2.14.18
Kat Marchán [Mon, 15 Feb 2016 18:27:42 +0000 (10:27 -0800)]
deps: upgrade to npm 2.14.18

PR-URL: https://github.com/nodejs/node/pull/5245
Reviewed-By: Myles Borins <mborins@us.ibm.com>
8 years agodeps: backport 9da3ab6 from V8 upstream
Ali Ijaz Sheikh [Fri, 30 Oct 2015 18:57:23 +0000 (11:57 -0700)]
deps: backport 9da3ab6 from V8 upstream

This patch exposes a new flag perf_basic_prof_only_functions (disabled by
default) that can be useful for the use-case of running always-on profiling on
long running production jobs.

Original commit
https://github.com/v8/v8/commit/9da3ab661fe7190fcb99bd99db30cf95913d3659
  New flag --perf_basic_prof_only_functions
  Restricts linux perf-event code range reporting to functions only (i.e. on
  stubs.) While this makes the gathered ticks less accurate, it reduces the
  growth of the /tmp/perf-${pid}.map file.

  BUG=v8:3453
  R=hablich@chromium.org,danno@chromium.org
  LOG=N

  Review URL: https://codereview.chromium.org/1292743002

  Cr-Commit-Position: refs/heads/master@{#30179}

PR-URL: https://github.com/nodejs/node/pull/3609
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
8 years agodoc: update process.send() signature
cjihrig [Wed, 17 Feb 2016 16:13:18 +0000 (11:13 -0500)]
doc: update process.send() signature

This commit brings the process.send() signature into sync with
the child_process.send() documentation. Specifically, this commit
adds the callback argument and return type to the docs.

PR-URL: https://github.com/nodejs/node/pull/5284
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotest: mark test-http-regr-gh-2928 flaky
Rich Trott [Wed, 17 Feb 2016 11:44:25 +0000 (03:44 -0800)]
test: mark test-http-regr-gh-2928 flaky

`test-http-regr-gh-2928` is flay on SmartOS in CI.

Refs: https://github.com/nodejs/node/issues/5264
PR-URL: https://github.com/nodejs/node/pull/5280
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodoc: replace node-forward link in CONTRIBUTING.md
Ben Noordhuis [Sat, 13 Feb 2016 17:30:49 +0000 (18:30 +0100)]
doc: replace node-forward link in CONTRIBUTING.md

Direct high-level discussion and questions about IP and trademark policy
to the TSC repository.

PR-URL: https://github.com/nodejs/node/pull/5227
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Rod Vagg <r@va.gg>
8 years agotools: add recommended ES6 lint rules
Rich Trott [Sat, 13 Feb 2016 00:59:05 +0000 (16:59 -0800)]
tools: add recommended ES6 lint rules

Add the following (seemingly non-controversial) ESLint rules:

* `constructor-super`: Verify calls of `super()` in constructors. Flags
situations that will result in runtime errors. Since we do not have 100%
code coverage in tests, linting for runtime errors is useful.
* `no-class-assign`: Flags cases where a class declaration is
overwritten via variable assignment later. It is difficult to think of a
situation where this is not an error, and easy to think of situations
(particularly in lengthy test files) where it could come up.
* `no-const-assign`: Assigning to a const after declaration is a runtime
error.
* `no-dupe-class-members`: Declare a class member twice, then only the
second one counts. This is analogous to redeclaring a variable.
* `no-this-before-super`: Using `this` or `super` in a derived class
before a call to `super()` is a `ReferenceError`

PR-URL: https://github.com/nodejs/node/pull/5210
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Rod Vagg <rod@vagg.org>
8 years agotest: mark test-http-agent flaky
Rich Trott [Fri, 12 Feb 2016 22:27:40 +0000 (14:27 -0800)]
test: mark test-http-agent flaky

Ref: https://github.com/nodejs/node/issues/5184
PR-URL: https://github.com/nodejs/node/pull/5209
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
8 years agodoc: fix minor inconsistencies in repl doc
Rich Trott [Thu, 11 Feb 2016 06:11:26 +0000 (22:11 -0800)]
doc: fix minor inconsistencies in repl doc

PR-URL: https://github.com/nodejs/node/pull/5193
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotest: minimal repl eval option test
Rich Trott [Thu, 11 Feb 2016 05:44:15 +0000 (21:44 -0800)]
test: minimal repl eval option test

Fixes: https://github.com/nodejs/node/issues/3544
PR-URL: https://github.com/nodejs/node/pull/5192
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotools: add recommended linting rules
Rich Trott [Wed, 10 Feb 2016 23:05:36 +0000 (15:05 -0800)]
tools: add recommended linting rules

This change adds ESLint rules that meet two criteria:

* recommended by ESLint
* require no code changes

These rules are:

* `no-func-assign`: Disallow overwriting a function that was written
as a function declaration.
* `no-negated-in-lhs`: Disallow negated left operand of `in` operator.
It prevents `if(!a in b)` when `if(!(a in b))` is intended.
* `no-obj-calls`: Disallow global object function calls. It prevents
errors like `JSON()` and `Math()`.
to exercise the code in tests or whatever, it can sneak in.
* `use-isnan`: Prevents errors like `if (foo == NaN)`
* `no-octal`: Disallows confusing constructs like `var num = 071;`
* `no-delete-var`: Delete works on properties, not variables. Disallows
`delete foo`.

PR-URL: https://github.com/nodejs/node/pull/5188
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
8 years agotest: disable fs watch tests for AIX
Michael Dawson [Wed, 10 Feb 2016 20:56:26 +0000 (15:56 -0500)]
test: disable fs watch tests for AIX

fs watch currently needs special configuration on AIX and we
want to improve under https://github.com/nodejs/node/issues/5085.
Tests are disabled so CI can be green and we can spot other
regressions until this work is complete.

test-async-wrap-check-providers does not aim to test fs watch
but part of the test uses it so that part has been skipped for
AIX

PR-URL: https://github.com/nodejs/node/pull/5187
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
8 years agodoc: clarify exceptions during uncaughtException
Noah Rose [Wed, 10 Feb 2016 18:30:30 +0000 (10:30 -0800)]
doc: clarify exceptions during uncaughtException

PR-URL: https://github.com/nodejs/node/pull/5180
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Benjamin Gruenbaum <inglor@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
8 years agotest: fix child-process-fork-regr-gh-2847 again
Santiago Gimeno [Wed, 10 Feb 2016 18:51:32 +0000 (19:51 +0100)]
test: fix child-process-fork-regr-gh-2847 again

Windows is still sometimes failing with ECONNRESET. Bring back the
handling of this error as was initially introduced in PR #4442.

PR-URL: https://github.com/nodejs/node/pull/5179
Reviewed-By: Rich Trott <rtrott@gmail.com>
Fixes: https://github.com/nodejs/node/issues/3635

8 years agodoc: update DCO to v1.1
Mikeal Rogers [Tue, 9 Feb 2016 22:07:49 +0000 (14:07 -0800)]
doc: update DCO to v1.1

PR-URL: https://github.com/nodejs/node/pull/5170
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
8 years agotest: fix flaky test-http-regr-gh-2928
Rich Trott [Tue, 9 Feb 2016 05:26:10 +0000 (21:26 -0800)]
test: fix flaky test-http-regr-gh-2928

Fix flaky test-http-regr-gh-2928 that has been failing on Raspberry Pi
devices in CI.

Fixes: https://github.com/nodejs/node/issues/4830
PR-URL: https://github.com/nodejs/node/pull/5154
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rod Vagg <r@va.gg>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
8 years agotools: remove excessive comments from .eslintrc
Rich Trott [Tue, 9 Feb 2016 04:23:42 +0000 (20:23 -0800)]
tools: remove excessive comments from .eslintrc

The comments make the config hard to scan. They do not provide any
information that isn't in the documentation links referred to in
comments (that are not being removed here).

Additionally, all rule config sections are alphabetically ordered for
easier scanning etc.

PR-URL: https://github.com/nodejs/node/pull/5151
Reviewed-By: Roman Reiss <me@silverwind.io>
8 years agotest: enable to work pkcs12 test in FIPS mode
Shigeki Ohtsu [Tue, 9 Feb 2016 01:49:37 +0000 (10:49 +0900)]
test: enable to work pkcs12 test in FIPS mode

The pfx file created by pkcs12 command of openssl causes an error in
FIPS mode because its certificate is encrypted with RC2 by default.
Adding `-descert` option resolves the error.

Fix: https://github.com/nodejs/node/pull/5144
Fix: https://github.com/nodejs/node/pull/5109
PR-URL: https://github.com/nodejs/node/pull/5150
Reviewed-By: Rich Trott <rtrott@gmail.com>
8 years agotest: remove unneeded common.indirectInstanceOf()
Rich Trott [Tue, 9 Feb 2016 00:32:13 +0000 (16:32 -0800)]
test: remove unneeded common.indirectInstanceOf()

PR-URL: https://github.com/nodejs/node/pull/5149
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
8 years agotest: disable gh-5100 test when in FIPS mode
Fedor Indutny [Mon, 8 Feb 2016 21:41:11 +0000 (16:41 -0500)]
test: disable gh-5100 test when in FIPS mode

This is a follow-up fix for half-broken test in 23196fe, and an attempt
to recover some dignity after breaking CI.

PR-URL: https://github.com/nodejs/node/pull/5144
Reviewed-By: Rich Trott <rtrott@gmail.com>
8 years agotools: enable no-proto rule for linter
Jackson Tian [Mon, 8 Feb 2016 13:12:09 +0000 (21:12 +0800)]
tools: enable no-proto rule for linter

Enable `no-proto` in `.eslintrc`.

Use `Object.setPrototypeOf()` and `Object.getPrototypeOf()`
instead of.

PR-URL: https://github.com/nodejs/node/pull/5140
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotools: disallow mixed spaces and tabs for indents
Rich Trott [Mon, 8 Feb 2016 18:41:15 +0000 (10:41 -0800)]
tools: disallow mixed spaces and tabs for indents

Enable eslint rule disallowing mixing tabs and spaces for indentation.
Modify the one file that had been mixing tabs and spaces.

PR-URL: https://github.com/nodejs/node/pull/5135
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
8 years agotools: alphabetize eslint stylistic issues section
Rich Trott [Mon, 8 Feb 2016 04:57:14 +0000 (20:57 -0800)]
tools: alphabetize eslint stylistic issues section

Rearrange the style rules in .eslintrc to be in alphabetical order.

This has two benefits:

It means the rules appear in the same order as they do in the ESLint
documentation, easing cross-referencing.

It also means that it is much easier to determine with visual inspection
if a rule is set or not.

https://github.com/nodejs/node/pull/5135
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
8 years agotest: fix flaky test-dgram-pingpong
Rich Trott [Fri, 5 Feb 2016 00:27:15 +0000 (16:27 -0800)]
test: fix flaky test-dgram-pingpong

There is no guarantee UDP messages will be received. Accommodate the
occasional dropped message.

This is a functionality test, not a performance benchmark. Speed up the
test by not sending 1500 messages across three ports.

Fixes: https://github.com/nodejs/node/issues/4526
PR-URL: https://github.com/nodejs/node/pull/5125
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotest: fix child-process-fork-regr-gh-2847
Santiago Gimeno [Sat, 6 Feb 2016 15:19:03 +0000 (16:19 +0100)]
test: fix child-process-fork-regr-gh-2847

The test would sometimes time out on some platforms. Take the initial
version of the test and instead of sending 100 handles, just send 2.
It still fails when run with the code before the change was introduced
and passes afterwards.

Remove test from parallel.status.

PR-URL: https://github.com/nodejs/node/pull/5121
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Fixes: https://github.com/nodejs/node/issues/3635

8 years agodoc: fix dgram doc indentation
Rich Trott [Sat, 6 Feb 2016 07:58:35 +0000 (23:58 -0800)]
doc: fix dgram doc indentation

PR-URL: https://github.com/nodejs/node/pull/5118
Reviewed-By: Roman Reiss <me@silverwind.io>
8 years agotools: lint for empty character classes in regex
Rich Trott [Sat, 6 Feb 2016 04:39:45 +0000 (20:39 -0800)]
tools: lint for empty character classes in regex

Enable linting rule to forbid empty character classes in regular
expressions. See http://eslint.org/docs/rules/no-empty-character-class

Organize "Possible Error" rules in .eslintrc in alphabetical order to
match eslint documentation.

PR-URL: https://github.com/nodejs/node/pull/5115
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodoc: fix typo in dgram doc
Rich Trott [Sat, 6 Feb 2016 04:18:09 +0000 (20:18 -0800)]
doc: fix typo in dgram doc

Remove stray square brackets from dgram documentation.

PR-URL: https://github.com/nodejs/node/pull/5114
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>

8 years agocrypto: fix memory leak in LoadPKCS12
Fedor Indutny [Sat, 6 Feb 2016 04:13:36 +0000 (23:13 -0500)]
crypto: fix memory leak in LoadPKCS12

`sk_X509_pop_free` should be used instead of `sk_X509_free` to free all
items in queue too, not just the queue itself.

PR-URL: https://github.com/nodejs/node/pull/5109
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
8 years agocrypto: add `pfx` certs as CA certs too
Fedor Indutny [Sat, 6 Feb 2016 04:13:30 +0000 (23:13 -0500)]
crypto: add `pfx` certs as CA certs too

According to documentation all certificates specified in `pfx` option
should be treated as a CA certificates too. While it doesn't seem to be
logically correct to me, we can't afford to break API stability at this
point.

Fix: #5100
PR-URL: https://github.com/nodejs/node/pull/5109
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
8 years agotest: don't run test-tick-processor.js on Aix
Michael Dawson [Thu, 4 Feb 2016 23:30:13 +0000 (18:30 -0500)]
test: don't run test-tick-processor.js on Aix

Currently the test-tick-processor functionality in V8
depends on addresses being smaller than a full 64 bits.  Aix supports
the full 64 bits and the result is that it does not process the
addresses correctly and runs of out memory.
Disabling until we get a fix upstreamed into V8.

PR-URL: https://github.com/nodejs/node/pull/5093
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: thefourtheye - Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
8 years agotest: mark flaky tests on Raspberry Pi
Rich Trott [Thu, 4 Feb 2016 19:55:50 +0000 (11:55 -0800)]
test: mark flaky tests on Raspberry Pi

A few tests have started failing on Raspberry Pi devices in CI.
https://ci.nodejs.org/job/node-test-binary-arm/943/

PR-URL: https://github.com/nodejs/node/pull/5082
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
Ref: https://github.com/nodejs/node/issues/4830
Ref: https://github.com/nodejs/node/issues/3635
Ref: https://github.com/nodejs/node/issues/4526

8 years agosrc: clean up usage of __proto__
Jackson Tian [Thu, 4 Feb 2016 02:53:17 +0000 (10:53 +0800)]
src: clean up usage of __proto__

Prefer using Object.setPrototypeOf() instead.

PR-URL: https://github.com/nodejs/node/pull/5069
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodoc: fix link in cluster documentation
Timothy Gu [Thu, 4 Feb 2016 02:33:39 +0000 (18:33 -0800)]
doc: fix link in cluster documentation

PR-URL: https://github.com/nodejs/node/pull/5068
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotools: lint for spacing around unary operators
Rich Trott [Wed, 3 Feb 2016 20:27:40 +0000 (12:27 -0800)]
tools: lint for spacing around unary operators

Enable `space-unary-ops` in `.eslintrc`. This prohibits things like:

    i ++        // use `i++` instead
    typeof(foo) // use `typeof foo` or `typeof (foo)` instead

Ref: https://github.com/nodejs/node/pull/4772#discussion_r51732299
PR-URL: https://github.com/nodejs/node/pull/5063
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotools: enable no-redeclare rule for linter
Rich Trott [Thu, 14 Jan 2016 00:14:28 +0000 (16:14 -0800)]
tools: enable no-redeclare rule for linter

PR-URL: https://github.com/nodejs/node/pull/5047
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotools: fix redeclared vars in doc/json.js
Rich Trott [Wed, 3 Feb 2016 00:20:44 +0000 (16:20 -0800)]
tools: fix redeclared vars in doc/json.js

PR-URL: https://github.com/nodejs/node/pull/5047
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodeps: backport 8d00c2c from v8 upstream
Gibson Fahnestock [Mon, 1 Feb 2016 12:13:28 +0000 (12:13 +0000)]
deps: backport 8d00c2c from v8 upstream

Original commit message:

```
Stop profiler on isolate teardown if still running

If the profiler is started via the API and not stopped, V8 will
 intermittently crash during isolate teardown.

The fix is to run the DeleteAllProfiles function in Isolate::Deinit()
 if cpu_profiler_ still exists.

https://groups.google.com/forum/#!topic/v8-dev/WsIlpbaD4mo

TEST= Run in debug mode, if you start a profile and don't stop it,
 this assert should fail:

   Fatal error in ../src/profiler/cpu-profiler.cc, line 414
   Check failed: !is_profiling_.

Review URL: https://codereview.chromium.org/1526253005

Cr-Commit-Position: refs/heads/master@{#32953}
```

PR-URL: https://github.com/nodejs/node/pull/5024
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
8 years agodoc: fix minor typo in process doc
Prayag Verma [Mon, 1 Feb 2016 04:49:05 +0000 (10:19 +0530)]
doc: fix minor typo in process doc

Remove extra `be`

PR-URL: https://github.com/nodejs/node/pull/5018
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
8 years agodoc: fix typo in Readme.md
Prayag Verma [Mon, 1 Feb 2016 04:37:08 +0000 (10:07 +0530)]
doc: fix typo in Readme.md

Spelling mistake - `begining` > `beginning`

PR-URL: https://github.com/nodejs/node/pull/5017
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
8 years agotest: fix inconsistent styling in test-url
Brian White [Sun, 31 Jan 2016 21:15:52 +0000 (16:15 -0500)]
test: fix inconsistent styling in test-url

PR-URL: https://github.com/nodejs/node/pull/5014
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodoc: minor improvement in OS docs
Alexander Makarenko [Sun, 31 Jan 2016 14:38:04 +0000 (17:38 +0300)]
doc: minor improvement in OS docs

Add links to `process.arch` and `process.platform`.

PR-URL: https://github.com/nodejs/node/pull/5006
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
8 years agodoc: improve styling consistency in VM docs
Alexander Makarenko [Sun, 31 Jan 2016 14:29:27 +0000 (17:29 +0300)]
doc: improve styling consistency in VM docs

Improve functions styling. Connect sections with links.

PR-URL: https://github.com/nodejs/node/pull/5005
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodoc: minor improvement to HTTPS doc
Alexander Makarenko [Sun, 31 Jan 2016 13:46:39 +0000 (16:46 +0300)]
doc: minor improvement to HTTPS doc

Add link to Buffer page.

PR-URL: https://github.com/nodejs/node/pull/5002
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Chris Dickinson <chris@neversaw.us>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotest: fix redeclared vars in sequential tests
Rich Trott [Sun, 31 Jan 2016 07:09:00 +0000 (23:09 -0800)]
test: fix redeclared vars in sequential tests

PR-URL: https://github.com/nodejs/node/pull/4999
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
8 years agotest: pummel test fixes
Rich Trott [Sun, 31 Jan 2016 06:58:19 +0000 (22:58 -0800)]
test: pummel test fixes

This fixes some variable redeclarations in pummel tests and, in the
process, gets `test-stream-pipe-multi.js` to run again. It had been
failing to run.

PR-URL: https://github.com/nodejs/node/pull/4998
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotest: fix redeclared vars in test-vm-*
Rich Trott [Sun, 31 Jan 2016 06:44:26 +0000 (22:44 -0800)]
test: fix redeclared vars in test-vm-*

PR-URL: https://github.com/nodejs/node/pull/4997
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotest: fix redeclared vars in test-url
Rich Trott [Sun, 31 Jan 2016 05:59:41 +0000 (21:59 -0800)]
test: fix redeclared vars in test-url

PR-URL: https://github.com/nodejs/node/pull/4993
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
8 years agodgram: scope redeclared variables
Rich Trott [Fri, 29 Jan 2016 04:08:57 +0000 (20:08 -0800)]
dgram: scope redeclared variables

A few variables in `lib/dgram.js` are redeclared with `var` in a scope
where they have already been declared. These instances can be scoped
more narrowly with `const`, so that's what this change does.

PR-URL: https://github.com/nodejs/node/pull/4940
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotest: fix redeclared test-util-* vars
Rich Trott [Sun, 31 Jan 2016 06:18:36 +0000 (22:18 -0800)]
test: fix redeclared test-util-* vars

PR-URL: https://github.com/nodejs/node/pull/4994
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
8 years agotest: fix variable redeclarations
Rich Trott [Sun, 31 Jan 2016 05:46:45 +0000 (21:46 -0800)]
test: fix variable redeclarations

I'm a fan of small changesets, but even I'm getting a little annoyed at
me for opening all these PRs weeding out variable redeclarations. So I'm
bundling a bunch of small changes here.

PR-URL: https://github.com/nodejs/node/pull/4992
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotest: fix redeclared test-path vars
Rich Trott [Sun, 31 Jan 2016 05:27:25 +0000 (21:27 -0800)]
test: fix redeclared test-path vars

PR-URL: https://github.com/nodejs/node/pull/4991
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotest: fix var redeclarations in test-os
Rich Trott [Sun, 31 Jan 2016 05:20:37 +0000 (21:20 -0800)]
test: fix var redeclarations in test-os

PR-URL: https://github.com/nodejs/node/pull/4990
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotest: fix test-net-* variable redeclarations
Rich Trott [Sun, 31 Jan 2016 05:14:12 +0000 (21:14 -0800)]
test: fix test-net-* variable redeclarations

PR-URL: https://github.com/nodejs/node/pull/4989
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
8 years agotest: fix redeclared test-intl var
Rich Trott [Sun, 31 Jan 2016 04:47:31 +0000 (20:47 -0800)]
test: fix redeclared test-intl var

PR-URL: https://github.com/nodejs/node/pull/4988
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
8 years agotest: fix redeclared test-http-* vars
Rich Trott [Sun, 31 Jan 2016 04:43:11 +0000 (20:43 -0800)]
test: fix redeclared test-http-* vars

PR-URL: https://github.com/nodejs/node/pull/4987
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
8 years agotest: fix redeclared test-event-emitter-* vars
Rich Trott [Sun, 31 Jan 2016 04:16:14 +0000 (20:16 -0800)]
test: fix redeclared test-event-emitter-* vars

PR-URL: https://github.com/nodejs/node/pull/4985
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
8 years agotest: remove redeclared var in test-domain
Rich Trott [Sun, 31 Jan 2016 04:08:42 +0000 (20:08 -0800)]
test: remove redeclared var in test-domain

PR-URL: https://github.com/nodejs/node/pull/4984
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
8 years agohttps: evict cached sessions on error
Fedor Indutny [Sat, 30 Jan 2016 23:49:11 +0000 (18:49 -0500)]
https: evict cached sessions on error

Instead of using the same session over and over, evict it when the
socket emits error. This could be used as a mitigation of #3692, until
OpenSSL fix will be merged/released.

See: https://github.com/nodejs/node/issues/3692
PR-URL: https://github.com/nodejs/node/pull/4982
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
8 years agotest: remove var redeclarations in test-crypto-*
Rich Trott [Sat, 30 Jan 2016 23:43:38 +0000 (15:43 -0800)]
test: remove var redeclarations in test-crypto-*

PR-URL: https://github.com/nodejs/node/pull/4981
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotest: remove test-cluster-* var redeclarations
Rich Trott [Sat, 30 Jan 2016 23:22:35 +0000 (15:22 -0800)]
test: remove test-cluster-* var redeclarations

PR-URL: https://github.com/nodejs/node/pull/4980
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotest: fix test-http-extra-response flakiness
Santiago Gimeno [Sat, 30 Jan 2016 19:55:07 +0000 (20:55 +0100)]
test: fix test-http-extra-response flakiness

It can happen that the extra response is to be sent in a different chunk
from the rest of the data. At this moment, the client might have already
closed the socket causing an `ECONNRESET` error.

PR-URL: https://github.com/nodejs/node/pull/4979
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agolib: remove string_decoder.js var redeclarations
Rich Trott [Sat, 30 Jan 2016 23:08:56 +0000 (15:08 -0800)]
lib: remove string_decoder.js var redeclarations

PR-URL: https://github.com/nodejs/node/pull/4978
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agorepl: remove variable redeclaration
Rich Trott [Sat, 30 Jan 2016 23:01:06 +0000 (15:01 -0800)]
repl: remove variable redeclaration

`match` and `filter` are declared twice with `var` in `repl.js`.
Declare the variables only once.

PR-URL: https://github.com/nodejs/node/pull/4977
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotools: apply linting to doc tools
Rich Trott [Sat, 30 Jan 2016 18:17:57 +0000 (10:17 -0800)]
tools: apply linting to doc tools

Apply eslint rules to `tools/doc`.

PR-URL: https://github.com/nodejs/node/pull/4973
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
8 years agotools: fix detecting constructor for JSON doc
Timothy Gu [Sat, 30 Jan 2016 05:11:49 +0000 (21:11 -0800)]
tools: fix detecting constructor for JSON doc

Regex previous was not detecting cases like AssertionError as
a class name.

PR-URL: https://github.com/nodejs/node/pull/4966
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chris Dickinson <chris@neversaw.us>
8 years agolib: scope loop variables
Rich Trott [Sat, 30 Jan 2016 04:34:13 +0000 (20:34 -0800)]
lib: scope loop variables

Refactor instances in `lib` where a loop variable is redeclared in the
same scope with `var`. In these cases, `let` can be used to scope the
variable declarations more precisely.

PR-URL: https://github.com/nodejs/node/pull/4965
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agonet: refactor redeclared variables
Rich Trott [Sat, 30 Jan 2016 03:57:34 +0000 (19:57 -0800)]
net: refactor redeclared variables

`lib/net.js` contained four variables that were redeclared with `var` in
the same scope. This change refactors those redeclarations so they are
scoped properly.

PR-URL: https://github.com/nodejs/node/pull/4963
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agomodule: refactor redeclared variable
Rich Trott [Sat, 30 Jan 2016 03:45:20 +0000 (19:45 -0800)]
module: refactor redeclared variable

`homedir` was declared with `var` twice in the same scope in
`lib/module.js`. This change makes it a single declaration.

PR-URL: https://github.com/nodejs/node/pull/4962
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
8 years agofs: refactor redeclared variables
Rich Trott [Fri, 29 Jan 2016 22:03:13 +0000 (14:03 -0800)]
fs: refactor redeclared variables

Two variables are declared twice with `var` in the same scope in
`lib/fs.js`. This change refactors the code so the variable is declared
just once.

PR-URL: https://github.com/nodejs/node/pull/4959
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
8 years agodoc: spell writable consistently
Peter Lyons [Fri, 29 Jan 2016 17:58:50 +0000 (10:58 -0700)]
doc: spell writable consistently

Docs have 108 instances of "writable" and only 1 "writeable" so
fix this one.

PR-URL: https://github.com/nodejs/node/pull/4954
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
8 years agotest: scope redeclared vars in test-child-process*
Rich Trott [Fri, 29 Jan 2016 07:02:57 +0000 (23:02 -0800)]
test: scope redeclared vars in test-child-process*

A handful of child process tests had variables declared multiple times
in the same scope using `var`. This change scopes those declarations.

PR-URL: https://github.com/nodejs/node/pull/4944
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
8 years agotest: refactor switch
Rich Trott [Tue, 26 Jan 2016 00:07:59 +0000 (16:07 -0800)]
test: refactor switch

`test-child-process-fork-net2.js` has a switch statement with 6 cases.
Each case uses `child.send()`, passing an object for the callback.
`child.send()` ignores the callback because it is not a function.
Removing the unused argument.

PR-URL: https://github.com/nodejs/node/pull/4870
Reviewed-By: Alexis Campailla <orangemocha@nodejs.org>
8 years agotest: add common.platformTimeout() to dgram test
Rich Trott [Thu, 28 Jan 2016 23:59:35 +0000 (15:59 -0800)]
test: add common.platformTimeout() to dgram test

Use common.platformTimeout() to mitigate potential for CI to timeout
on slower devices.

Ref: https://github.com/nodejs/node/issues/4937
PR-URL: https://github.com/nodejs/node/pull/4938
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Myles Borins <mborins@us.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
8 years agotest: fix flaky cluster test on Windows 10
Rich Trott [Thu, 28 Jan 2016 06:00:33 +0000 (22:00 -0800)]
test: fix flaky cluster test on Windows 10

test-cluster-shared-leak was flaky on Windows 10. Remove unnecessary
.send() calls and replace with .disconnect() to avoid spurious EPIPE.

Fixes: https://github.com/nodejs/node/issues/4887
PR-URL: https://github.com/nodejs/node/pull/4934
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodoc: update eol handling in readline
Kári Tristan Helgason [Thu, 28 Jan 2016 11:01:20 +0000 (11:01 +0000)]
doc: update eol handling in readline

This commit explicitly calls out the end of line sequences
used to generate line events in the readline module.

Fixes: https://github.com/nodejs/node/issues/4916
PR-URL: https://github.com/nodejs/node/pull/4927
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
8 years agodoc: add more details to process.env
Evan Lucas [Thu, 28 Jan 2016 03:27:56 +0000 (21:27 -0600)]
doc: add more details to process.env

process.env has a few quirks that deserve documenting.

The commit documents:

- How assigning to process.env will implicitly call `toString()`
- How to remove an environment variable from process.env

PR-URL: https://github.com/nodejs/node/pull/4924
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>