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

18119 Commits

Author SHA1 Message Date
Michael Dawson
ac41db4af0 n-api: add code parameter to error helpers
In support of the effort to add error codes to all errors
generated by Node.js, add an optional code parameter to the
helper functions used to throw/create errors in N-API.

PR-URL: https://github.com/nodejs/node/pull/13988
Fixes: https://github.com/nodejs/node/issues/13933
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-07-13 15:05:19 -04:00
cjihrig
598a128ff4 test: handle missing V8 tests in n-api test
The N-API test testInstanceOf.js relies on several V8 test files
which may not exist in downloadable archives. If the files are
missing, this commit causes a warning to be emitted rather than
failing the test.

Refs: https://github.com/nodejs/node/issues/14113
Fixes: https://github.com/nodejs/node/issues/13344
PR-URL: https://github.com/nodejs/node/pull/14123
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-07-13 11:51:43 -04:00
cjihrig
462b2466b3 deps: upgrade libuv to 1.13.1
PR-URL: https://github.com/nodejs/node/pull/14117
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-07-13 11:25:10 -04:00
Andreas Madsen
31417b6882
async_hooks: make AsyncResource match emitInit
AsyncResource previously called emitInitNative. Since AsyncResource is
just an abstraction on top of the emitEventScript functions, it should
call emitInitScript instead.

PR-URL: https://github.com/nodejs/node/pull/14152
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-07-13 14:15:06 +02:00
Andreas Madsen
628485ea01
async_hooks: rename internal emit functions
There are two categories of emit functions in async_hooks, those used by
c++ (native) and those used by JavaScript (script). Previously these
were named N for native and S for script. Finally, there was an odd case
where emitInitN was called just init. This makes it more explicit by
using the names emitInitNative and emitInitScript. The other emit
functions are also renamed.

PR-URL: https://github.com/nodejs/node/pull/14152
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-07-13 14:13:22 +02:00
Andreas Madsen
f94fd0c0f3
async_hooks: fix nested hooks mutation
In some cases restoreTmpHooks is called too early, this causes
active_hooks_array to change during execution of the init hooks.

PR-URL: https://github.com/nodejs/node/pull/14143
Ref: https://github.com/nodejs/node/pull/14054#issuecomment-313915193
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-07-13 11:59:18 +02:00
Ruben Bridgewater
8a830350b2
async_hooks: move restoreTmpHooks call to init
This fixes an error that could occure by nesting async_hooks calls

PR-URL: https://github.com/nodejs/node/pull/14054
Ref: https://github.com/nodejs/node/pull/13755#issuecomment-312616004
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
2017-07-13 11:57:44 +02:00
Ruben Bridgewater
5ffb5b6fce
test: improve the test common documentation
PR-URL: https://github.com/nodejs/node/pull/14148
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-07-13 10:27:23 +08:00
Rich Trott
76fa6b21a1 tools: increase test timeouts
At least temporarily until snapshots are restored, increase timeout for
tests. Tests that spawn many processes are timing out across many
platforms on CI.

PR-URL: https://github.com/nodejs/node/pull/14197
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-07-12 15:59:30 -07:00
starkwang
dbfe8c4ea2
errors,buffer: port errors to internal/errors
PR-URL: https://github.com/nodejs/node/pull/13976
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2017-07-12 17:00:30 -04:00
Rich Trott
1562fb9ea7 tools: update ESLint to 4.2.0
ESLint 4.2.0 contains a fix for a bug that is blocking us from moving to
the non-legacy stricter indentation linting. Update to 4.2.0 to remove
the blocking issue.

PR-URL: https://github.com/nodejs/node/pull/14155
Ref: https://github.com/eslint/eslint/issues/8882
Ref: https://github.com/eslint/eslint/pull/8885
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-07-12 12:39:41 -07:00
Rich Trott
6d090e1094 child_process: refactor normalizeSpawnArguments()
Code is not in hot path. Refactor ternary to be more readable if/else
block that mirrors analogous code elsewhere in the function. Change
string concatenation to template literal.

PR-URL: https://github.com/nodejs/node/pull/14149
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-07-12 12:09:43 -07:00
Roman Shoryn
7f26a291f6
doc: prefix of the stacktrace in errors.md
PR-URL: https://github.com/nodejs/node/pull/14150
Fixes: https://github.com/nodejs/node/issues/5675
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Kunal Pathak <kunal.pathak@microsoft.com>
2017-07-12 15:06:16 -04:00
Trevor Norris
3b4010be31
test,async_hooks: match test-ttywrap.readstream
Match changes made to test-ttywrap.readstream for consistency.

PR-URL: https://github.com/nodejs/node/pull/13991
Fixes: https://github.com/nodejs/node/issues/13984
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-07-12 14:44:43 -04:00
Trevor Norris
250d50b380
test,async_hooks: skip whether TTY is available
If TTY isn't available then the test will always fail. Also use the
already available process.stdin instead of opening another ReadStream.

PR-URL: https://github.com/nodejs/node/pull/13991
Fixes: https://github.com/nodejs/node/issues/13984
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-07-12 14:44:41 -04:00
Kyle Farnung
f52c707853 n-api: wrap test macros in do/while
PR-URL: https://github.com/nodejs/node/pull/14095
Reviewed-By: Jason Ginchereau <jasongin@microsoft.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-07-12 12:26:15 -04:00
Gabriel Schulhof
d5b397c9b6 n-api: Implement stricter wrapping
Use a stronger criterion to identify objects in the prototype chain that store
pointers to native data that were added by previous calls to `napi_wrap()`.

Whereas the old criterion for identifying `napi_wrap()`-injected prototype
chain objects was to consider an object with an internal field
count of 1 to be such an object, the new criterion is to consider an object
with an internal field count of 2 such that the second field holds a
`v8::External` which itself contains a pointer to a global static string unique
to N-API to be a `napi_wrap()`-injected prototype chain object.

This greatly reduces the possibility of returning a pointer that was not
previously added with `napi_wrap()`, and it allows us to recognize that an
object has already undergone `napi_wrap()` and we can thus prevent a chain of
wrappers only the first of which is accessible from appearing in the prototype
chain, as would be the result of multiple calls to `napi_wrap()` using the same
object.

PR-URL: https://github.com/nodejs/node/pull/13872
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-07-12 12:05:44 -04:00
Rich Trott
3eae310334 test: reduce run time for test-benchmark-crypto
Specify options to reduce combinations of benchmarks run during testing.
This reduces the run time by approximately 30% and will hopefully allow
Raspberry Pi 1 devices in CI to finish the test.

PR-URL: https://github.com/nodejs/node/pull/14189
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-07-12 08:45:13 -07:00
Rich Trott
daead5a767 test: reduce run time for test-benchmark-http
Specify more configuration options to reduce run time by about a third.

PR-URL: https://github.com/nodejs/node/pull/14180
Fixes: https://github.com/nodejs/node/issues/14177
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-07-12 08:40:45 -07:00
Rich Trott
82aa34ed1f test: reduce test-benchmark-net run duration
Set configuration option to reduce combinations of benchmark settings
tried in test, reducing execution time by about 50%.

PR-URL: https://github.com/nodejs/node/pull/14183
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-07-12 06:30:44 -07:00
Timothy Gu
b5b7c3b432
doc: add missing space
PR-URL: https://github.com/nodejs/node/pull/14181
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-07-12 15:18:53 +02:00
Timothy Gu
afab5aba32
querystring: fix up lastPos usage
Use lastPos ONLY for tracking what has been .slice()'d, never as an
indication of if key/value has been seen, since lastPos is updated on
seeing + as well.

PR-URL: https://github.com/nodejs/node/pull/14151
Fixes: https://github.com/nodejs/node/issues/13773
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2017-07-12 12:12:48 +08:00
Rich Trott
e6e6b07e51 buffer: remove MAX_SAFE_INTEGER check on length
MAX_SAFE_INTEGER is millions of times larger than the largest buffer
allowed in Node.js. There is no need to squash the length down to
MAX_SAFE_INTEGER. Removing that check results in a small but
statistically significant increase for Buffer.from() operating on
ArrayBuffers in some situations.

PR-URL: https://github.com/nodejs/node/pull/14131
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-07-11 18:25:09 -07:00
Evan Lucas
80c9fd9569 test: add get/set effective uid/gid tests
3c92ca2b5c should have had tests
to go along with it. This adds tests for the following functions:

* `process.geteuid()`
* `process.seteuid()`
* `process.getegid()`
* `process.setegid()`

PR-URL: https://github.com/nodejs/node/pull/14091
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-07-11 12:36:52 -05:00
Rich Trott
b20a0b662b test: fix flaky test-https-set-timeout-server
Because of a race condition, connection listener may not be invoked if
test is run under load. Remove `common.mustCall()` wrapper from the
listener. Move the test to `parallel` because it now works under load.
Make similar change to http test to keep them in synch even though it is
much harder to trigger the race in http.

PR-URL: https://github.com/nodejs/node/pull/14134
Fixes: https://github.com/nodejs/node/issues/14133
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-07-11 10:09:06 -07:00
Evan Lucas
22889347df 2017-07-11, Version 8.1.4 (Current)
This is a security release. All Node.js users should consult the
security release summary at
https://nodejs.org/en/blog/vulnerability/july-2017-security-releases/
for details on patched vulnerabilities.

Notable changes

* **build**:
  - Disable V8 snapshots - The hashseed embedded in the snapshot is
    currently the same for all runs of the binary. This opens node up to
collision attacks which could result in a Denial of Service. We have
temporarily disabled snapshots until a more robust solution is found
(Ali Ijaz Sheikh)
* **deps**:
  - CVE-2017-1000381 - The c-ares function ares_parse_naptr_reply(),
    which is used for parsing NAPTR responses, could be triggered to
read memory outside of the given input buffer if the passed in DNS
response packet was crafted in a particular way. This patch checks that
there is enough data for the required elements of an NAPTR record (2
int16, 3 bytes for string lengths) before processing a record. (David
Drysdale)

PR-URL: https://github.com/nodejs/node-private/pull/91
2017-07-11 11:57:37 -05:00
Evan Lucas
89e121d4a7 2017-07-11, Version 7.10.1 (Current)
This is a security release. All Node.js users should consult the
security release summary at
https://nodejs.org/en/blog/vulnerability/july-2017-security-releases/
for details on patched vulnerabilities.

* **build**:
  - Disable V8 snapshots - The hashseed embedded in the snapshot is
    currently the same for all runs of the binary. This opens node up to
collision attacks which could result in a Denial of Service. We have
temporarily disabled snapshots until a more robust solution is found
(Ali Ijaz Sheikh)
* **deps**:
  - CVE-2017-1000381 - The c-ares function ares_parse_naptr_reply(),
    which is used for parsing NAPTR responses, could be triggered to
read memory outside of the given input buffer if the passed in DNS
response packet was crafted in a particular way. This patch checks that
there is enough data for the required elements of an NAPTR record (2
int16, 3 bytes for string lengths) before processing a record. (David
Drysdale)

PR-URL: https://github.com/nodejs/node-private/pull/92
2017-07-11 11:56:23 -05:00
Myles Borins
6218939cdd
2017-07-11, Version 6.11.1 'Boron' (LTS)
This is a security release. All Node.js users should consult the
security release summary at:

https://nodejs.org/en/blog/vulnerability/july-2017-security-releases/

for details on patched vulnerabilities.

Notable Changes:

* build:
  - Disable V8 snapshots - The hashseed embedded in the snapshot is
    currently the same for all runs of the binary. This opens node
    up to collision attacks which could result in a Denial of Service.
    We have temporarily disabled snapshots until a more robust solution
    is found (Ali Ijaz Sheikh)
* deps:
  - CVE-2017-1000381 - The c-ares function ares_parse_naptr_reply(),
    which is used for parsing NAPTR responses, could be triggered to
    read memory outside of the given input buffer if the passed in DNS
    response packet was crafted in a particular way. This patch checks
    that there is enough data for the required elements of an NAPTR
    record (2 int16, 3 bytes for string lengths) before processing a
    record. (David Drysdale)

PR-URL: https://github.com/nodejs/node-private/pull/89
2017-07-11 17:50:09 +01:00
Myles Borins
0130cf55bb
2017-07-11, Version 4.8.4 'Argon' (Maintenance)
This is a security release. All Node.js users should consult the
security release summary at:

https://nodejs.org/en/blog/vulnerability/july-2017-security-releases/

for details on patched vulnerabilities.

Notable Changes:

* build:
  - Disable V8 snapshots - The hashseed embedded in the snapshot is
    currently the same for all runs of the binary. This opens node
    up to collision attacks which could result in a Denial of Service.
    We have temporarily disabled snapshots until a more robust solution
    is found (Ali Ijaz Sheikh)
* deps:
  - CVE-2017-1000381 - The c-ares function ares_parse_naptr_reply(),
    which is used for parsing NAPTR responses, could be triggered to
    read memory outside of the given input buffer if the passed in DNS
    response packet was crafted in a particular way. This patch checks
    that there is enough data for the required elements of an NAPTR
    record (2 int16, 3 bytes for string lengths) before processing a
    record. (David Drysdale)

PR-URL: https://github.com/nodejs/node-private/pull/90
2017-07-11 17:49:34 +01:00
Ali Ijaz Sheikh
9fedc1f096
test: verify hash seed uniqueness
This tests that the hash seed used by V8 for hashing is random.

PR-URL: https://github.com/nodejs/node-private/pull/84
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: mhdawson - Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: indutny - Fedor Indutny <fedor.indutny@gmail.com>
2017-07-11 17:47:37 +01:00
Ali Ijaz Sheikh
eff636d8eb
build: disable V8 snapshots
PR-URL: https://github.com/nodejs/node-private/pull/84
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: mhdawson - Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: indutny - Fedor Indutny <fedor.indutny@gmail.com>
2017-07-11 17:47:37 +01:00
David Drysdale
a73142524b
deps: cherry-pick 9478908a49 from cares upstream
Original commit message:

  ares_parse_naptr_reply: check sufficient data

  Check that there is enough data for the required elements
  of an NAPTR record (2 int16, 3 bytes for string lengths)
  before processing a record.

This patch fixes CVE-2017-1000381

The c-ares function ares_parse_naptr_reply(), which is used for
parsing NAPTR responses, could be triggered to read memory outside
of the given input buffer if the passed in DNS response packet was
crafted in a particular way.

Refs: https://c-ares.haxx.se/adv_20170620.html
Refs: https://c-ares.haxx.se/CVE-2017-1000381.patch
PR-URL: https://github.com/nodejs/node-private/pull/88
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-07-11 17:46:16 +01:00
Rich Trott
199ad1d73f doc: correct stream Duplex allowHalfOpen doc
If allowHalfOpen is set to false, the stream will automatically end the
writable side when the readable side ends, but not the other way around.

PR-URL: https://github.com/nodejs/node/pull/14127
Fixes: https://github.com/nodejs/node/issues/4044
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-07-10 13:49:35 -07:00
Sam Roberts
97a6aa9b20 src: whitelist v8 options with '_' or '-'
V8 options allow either '_' or '-' to be used in options as a seperator,
such as "--abort-on_uncaught-exception". Allow these case variations
when used with NODE_OPTIONS.

PR-URL: https://github.com/nodejs/node/pull/14093
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-07-10 12:02:07 -07:00
Rich Trott
e0af017a32 lib: normalize indentation in parentheses
In anticipation of stricter indentation linting, normalize indentation
of code in parentheses.

PR-URL: https://github.com/nodejs/node/pull/14125
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-07-10 11:55:35 -07:00
Jimmy Thomson
94dd42577c
test: fix cctest failure on Windows
Linux converts the ipv6 address "::" to "::1", while windows does not.
By explicitly using "::1" in the test we allow it to succeed on windows.

PR-URL: https://github.com/nodejs/node/pull/14111
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Kunal Pathak <kunal.pathak@microsoft.com>
Reviewed-By: João Reis <reis@janeasystems.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-07-10 12:33:21 -04:00
Dean Coakley
ff07eaa140
doc: note 'resize' event conditions on Windows
PR-URL: https://github.com/nodejs/node/pull/13576
Fixes: https://github.com/nodejs/node/issues/13197
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-07-09 17:59:11 -04:00
Ruben Bridgewater
1b2733f272
test: common.expectsError should be a must call
Wrap expectsError in mustCall to make sure it's really called
as expected.

PR-URL: https://github.com/nodejs/node/pull/14088
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2017-07-09 14:19:13 -04:00
Ruben Bridgewater
be20e9ecfe
assert: refactor to reduce unecessary code paths
The lazy loading is not needed as the errors themself lazy
load assert. Therefore the circle is working as intended
even without this lazy loading.

Improve Array, object, ArrayBuffer, Set and Map performance
in all deepEqual checks by removing unecessary code paths and
by moving expensive checks further back.

Improve throws and doesNotThrow performance by removing dead
code and simplifying the overall logic.

PR-URL: https://github.com/nodejs/node/pull/13973
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-07-09 14:16:34 -04:00
Refael Ackermann
4d7946aec3
test: ignore connection errors for hostname check
PR-URL: https://github.com/nodejs/node/pull/14073
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-07-09 14:01:59 -04:00
Ruben Bridgewater
18069523f8
fs: two minor optimizations
* tryStatSync should not return any value
  If the function threw, it would never reach that code path.

* only use try catch if necessary
  lchmodSync does not need the second try catch in most cases.

PR-URL: https://github.com/nodejs/node/pull/14055
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-07-09 13:41:30 -04:00
Kyle Farnung
d48472c20f
build: split up cpplint to avoid long cmd lines
Refactors cpplint slightly to allow multiple runs of it. This allows
downstream projects to run cpplint on their dependencies.

PR-URL: https://github.com/nodejs/node/pull/14116
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Kunal Pathak <kunal.pathak@microsoft.com>
Reviewed-By: João Reis <reis@janeasystems.com>
2017-07-09 13:28:31 -04:00
Refael Ackermann
8206a01c99
build,win: skip vcvarsall.bat if env is set
PR-URL: https://github.com/nodejs/node/pull/13806
Fixes: https://github.com/nodejs/node/issues/13765
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Kunal Pathak <kunal.pathak@microsoft.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-07-09 13:21:33 -04:00
Refael Ackermann
d69ecc6f51
Revert "test: improve test-process-kill-null for Windows"
This reverts commit 44483b6898.

PR-URL: https://github.com/nodejs/node/pull/14142
Fixes: https://github.com/nodejs/node/issues/14141
Refs: https://github.com/nodejs/node/pull/14099
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-07-09 13:08:17 -04:00
Moogen Tian
d2aaf82fcf doc: fix mistake in http.md
If the first parameter of `request.end` `data` is specified, it should
be equivalent to calling `request.write(data, encoding)` (not
`response.write(data, encoding)`) followed by `request.end(callback)`.

This mistake was introduced in commit
14b3aab7d2:

    date: 28 November 2015 at 7:30:32 AM GMT+8
    author: jpersson <jonathan.persson@creuna.se>
    committer: James M Snell <jasnell@gmail.com>
    summary: doc: add links and backticks around names

PR-URL: https://github.com/nodejs/node/pull/14126
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: David Cai <davidcai1993@yahoo.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2017-07-09 18:47:35 +02:00
XadillaX
a2d3cec81c
doc,test: fs - reserved characters under win32
Explain the behavior of `fs.open()` under win32 that file path contains
some characters and add some test cases for them.

< (less than)
> (greater than)
: (colon)
" (double quote)
/ (forward slash)
\ (backslash)
| (vertical bar or pipe)
? (question mark)
* (asterisk)

PR-URL: https://github.com/nodejs/node/pull/13875
Refs: https://github.com/nodejs/node/issues/13868
Refs: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
Refs: https://msdn.microsoft.com/en-us/library/windows/desktop/bb540537.aspx
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-07-09 12:32:40 -04:00
Ruben Bridgewater
d6fece1436
test: add optional throw fn to expectsError
PR-URL: https://github.com/nodejs/node/pull/14089
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-07-08 16:00:57 -04:00
starkwang
44483b6898
test: improve test-process-kill-null for Windows
PR-URL: https://github.com/nodejs/node/pull/14099
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-07-08 15:47:27 -04:00
Jan Krems
b647f04df1 doc: match debugger output & instructions to master behavior
PR-URL: https://github.com/nodejs/node/pull/13885
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-07-08 09:25:16 -07:00
Rich Trott
6a1b8135d6 tools: generate template literal for addon tests
Instead of generating string concatenation, generate a template literal.
This is mostly useful as a pre-emptive measure for avoiding problems
when (if?) we enable the prefer-template lint rule in the test
directory.

PR-URL: https://github.com/nodejs/node/pull/14094
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-07-07 15:22:35 -07:00