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

17524 Commits

Author SHA1 Message Date
Artur Vieira
ad4765a326 test: remove common.PORT from dgram test
Remove common.PORT from
test-dgram-send-callback-buffer-length-empty-address to eliminate
possibility that a dynamic port used in another test will collide
with common.PORT.

PR-URL: https://github.com/nodejs/node/pull/12944
Refs: https://github.com/nodejs/node/issues/12376
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <mhdawson@ibm.com>
2017-05-22 12:48:26 +02:00
Artur Vieira
dd3c227796 test: bind to 0 in dgram-send-callback-buffer-length
Remove common.PORT from test-dgram-send-callback-buffer-length to
eliminate possibility that a dynamic port used in another test will
collide with common.PORT.

PR-URL: https://github.com/nodejs/node/pull/12943
Refs: https://github.com/nodejs/node/issues/12376
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <mhdawson@ibm.com>
2017-05-22 12:26:34 +02:00
Artur Vieira
281de19a8c test: use dynamic port in test-dgram-send-address-types
Remove common.PORT from test-dgram-send-address-types to eliminate
possibility that a dynamic port used in another test will collide
with common.PORT.

PR-URL: https://github.com/nodejs/node/pull/13007
Refs: https://github.com/nodejs/node/issues/12376
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-05-22 09:52:56 +02:00
Artur Vieira
e00116d2c4 test: use dynamic port in test-dgram-send-callback-buffer
Replace common.PORT with available port assigned by the operating
system in test-dgram-send-callback-buffer.

PR-URL: https://github.com/nodejs/node/pull/12942
Refs: https://github.com/nodejs/node/issues/12376
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <mhdawson@ibm.com>
2017-05-22 08:53:45 +02:00
Artur Vieira
4c847347c3 test: replace common.PORT in dgram test
Replace common.PORT with available port assigned by the operating
system in test-dgram-send-callback-buffer-empty-address.

PR-URL: https://github.com/nodejs/node/pull/12929
Refs: https://github.com/nodejs/node/issues/12376
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-05-22 08:38:57 +02:00
Matteo Collina
330c8d743e stream: add destroy and _destroy methods.
Adds destroy() and _destroy() methods to Readable, Writable, Duplex
and Transform. It also standardizes the behavior and the implementation
of destroy(), which has been inconsistent in userland and core.
This PR also updates all the subsystems of core to use the new
destroy().

PR-URL: https://github.com/nodejs/node/pull/12925
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Calvin Metcalf <calvin.metcalf@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-05-22 08:34:14 +02:00
Daniel Bevenius
d54ec726cc src: remove unnecessary forward declaration
I can't see that the forward declaration of class Connection is needed
and wanted to raise this in case it was overlooked after a previous
change.

PR-URL: https://github.com/nodejs/node/pull/13081
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-05-22 07:41:30 +02:00
Daniel Bevenius
57f38c6732 src: check IsConstructCall in TLSWrap constructor
Currently it is possible to call TLSWrap() without using new and the
following error message:
FATAL ERROR: v8::Object::SetAlignedPointerInInternalField() Internal
field out of bounds
 1: node::Abort()
[/Users/danielbevenius/work/nodejs/node/out/Debug/node]
 2: node::OnFatalError(char const*, char const*)
[/Users/danielbevenius/work/nodejs/node/out/Debug/node]
 3: v8::Utils::ReportApiFailure(char const*, char const*)
[/Users/danielbevenius/work/nodejs/node/out/Debug/node]
 4: v8::Utils::ApiCheck(bool, char const*, char const*)
[/Users/danielbevenius/work/nodejs/node/out/Debug/node]
 5: v8::InternalFieldOK(v8::internal::Handle<v8::internal::JSReceiver>,
int, char const*)
[/Users/danielbevenius/work/nodejs/node/out/Debug/node]
 6: v8::Object::SetAlignedPointerInInternalField(int, void*)
[/Users/danielbevenius/work/nodejs/node/out/Debug/node]
 7: node::TLSWrap::Initialize(v8::Local<v8::Object>,
v8::Local<v8::Value>,
v8::Local<v8::Context>)::$_0::operator()(v8::FunctionCallbackInfo<v8::Value>
const&) const [/Users/danielbevenius/work/nodejs/node/out/Debug/node]

This commit adds a IsConstructCall check which will produce the
following error message:
/Users/danielbevenius/work/nodejs/node/out/Debug/node[2212]:
../src/tls_wrap.cc:936:auto node::TLSWrap::Initialize(Local<v8::Object>,
Local<v8::Value>, Local<v8::Context>)::(anonymous
class)::operator()(const FunctionCallbackInfo<v8::Value> &) const:
Assertion `args.IsConstructCall()' failed.
 1: node::Abort()
[/Users/danielbevenius/work/nodejs/node/out/Debug/node]
 2: node::Assert(char const* const (*) [4])
[/Users/danielbevenius/work/nodejs/node/out/Debug/node]
 3: node::TLSWrap::Initialize(v8::Local<v8::Object>,
v8::Local<v8::Value>,
v8::Local<v8::Context>)::$_0::operator()(v8::FunctionCallbackInfo<v8::Value>
const&) const [/Users/danielbevenius/work/nodejs/node/out/Debug/node]

PR-URL: https://github.com/nodejs/node/pull/13097
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-05-22 07:31:04 +02:00
Daniel Bevenius
762b0358b3 src: remove unnecessary return statement
I think the code would be a little clearer if the return statement
was removed here since End() does not return any value and neither
does ParseHeader.

PR-URL: https://github.com/nodejs/node/pull/13094
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-05-22 07:22:51 +02:00
Daniel Bevenius
7a15eefbba src: remove unused node_buffer.h include
I can't find any usage of Buffer in this file and think the include
can be removed.

PR-URL: https://github.com/nodejs/node/pull/13095
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-05-22 05:45:45 +02:00
Rich Trott
8e47600aab test: allow for absent nobody user in setuid test
Some isolated build or test VMs don't have a "nobody" user, causing the
parallel/test-process-setuid-setgid test to fail. Add logic to allow for
that situation.

PR-URL: https://github.com/nodejs/node/pull/13112
Fixes: https://github.com/nodejs/node/issues/13071
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-05-21 20:09:10 -07:00
Rich Trott
c3067b5640 benchmark: allow no duration in benchmark tests
Imprecision in process.hrtime() in some situations can result in a zero
duration being used as a denominator in benchmark tests. This would
almost certainly never happen in real benchmarks. It is only likely in
very short benchmarks like the type we run in our test suite to just
make sure that the benchmark code is runnable.

So, if the environment variable that we use in tests to indicate "allow
ludicrously short benchmarks" is set, convert a zero duration for
a benchmark to 1 nano-second.

PR-URL: https://github.com/nodejs/node/pull/13110
Fixes: https://github.com/nodejs/node/issues/13102
Fixes: https://github.com/nodejs/node/issues/12433
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-05-21 20:05:13 -07:00
Rich Trott
171a43a986 test: shorten test-benchmark-http
Add `--set key=""` to cut down the time it takes to run
test-benchmark-http by about a third.

Alphabetize options in `--set` list.

PR-URL: https://github.com/nodejs/node/pull/13109
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-05-21 19:59:34 -07:00
Alexey Orlenko
9e4660b518
zlib: fix node crashing on invalid options
This commit fixes the Node process crashing when constructors of classes
of the zlib module are given invalid options.

* Throw an Error when the zlib library rejects the value of windowBits,
  instead of crashing with an assertion.

* Treat windowBits and memLevel options consistently with other ones and
  don't crash when non-numeric values are given.

* Fix bugs in the validation logic:
  - Don't conflate 0 and undefined when checking if a field of an
    options object exists.
  - Treat NaN and Infinity values the same way as values of invalid
    types instead of allowing to actually set zlib options to NaN or
    Infinity.

PR-URL: https://github.com/nodejs/node/pull/13098
Fixes: https://github.com/nodejs/node/issues/13082
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-05-22 01:10:44 +03:00
Shadowbeetle
6fb27af70a
async_hooks: add constructor check to async-hooks
This fixes the async_hooks.AsyncHook constructor such that it throws an
error when provided with falsy values other than undefined.

PR-URL: https://github.com/nodejs/node/pull/13096
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
2017-05-21 22:04:15 +02:00
Artur Vieira
ef71824740
doc: edit Error.captureStackTrace html comment
Edit to the comment in the stack trace capture, highlighting the use of
the constructorOpt argument in errors.md

Fixes: https://github.com/nodejs/node/issues/12289
PR-URL: https://github.com/nodejs/node/pull/12962
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben.bridgewater@fintura.de>
2017-05-21 21:36:07 +02:00
XadillaX
2b541471db
dns: fix resolve failed starts without network
Fix the bug that you start process without network at first, but it
connected lately, `dns.resolve` will stay failed with ECONNREFUSED
because c-ares servers fallback to 127.0.0.1 at the very beginning.

If c-ares servers "127.0.0.1" is detected and its not set by user self,
and last query is not OK, recreating `ares_channel` operation will be
triggered to reload servers.

Fixes: https://github.com/nodejs/node/issues/1644
PR-URL: https://github.com/nodejs/node/pull/13076
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-05-21 15:48:35 +02:00
Rich Trott
595e5e3b23 test: port disabled readline test
Port the disabled readline test to make it runnable in our usual test
suite.

PR-URL: https://github.com/nodejs/node/pull/13091
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-05-20 22:11:29 -07:00
Daijiro Wachi
bfade5aacd doc: remove unused/duplicated reference links
PR-URL: https://github.com/nodejs/node/pull/13066
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-05-21 00:10:47 +02:00
Myles Borins
8250bfd1e5
fs: Revert throw on invalid callbacks
This reverts 4cb5f3daa3

Based on community feedback I think we should consider reverting this
change. We should explore how this could be solved via linting rules.

Refs: https://github.com/nodejs/node/pull/12562
PR-URL: https://github.com/nodejs/node/pull/12976
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-05-20 10:21:34 -04:00
Artur G Vieira
c60a7fa738 test: move net reconnect error test to sequential
The usage of common.PORT could cause undesired port collisions when run
in parallel. The following test was moved to sequential.
test-net-reconnect-error.js

PR-URL: https://github.com/nodejs/node/pull/13033
Refs: https://github.com/nodejs/node/issues/12376
Reviewed-By: Rich Trott <rtrott@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: Refael Ackermann <refack@gmail.com>
2017-05-20 08:08:13 -04:00
Rajaram Gaunker
06a617aa21
url: update IDNA error conditions
This commit contains three separate changes:

- Always return a string from ToUnicode no matter if an error occurred.
- Disable CheckHyphens boolean flag. This flag will soon be enabled in
  the URL Standard, but is implemented manually by selectively ignoring
  certain errors.
- Enable CheckBidi boolean flag per URL Standard update.

This allows domain names with hyphens at 3 and 4th position, as well as
those with leading and trailing hyphens. They are technically invalid,
but seen in the wild.

Tests are updated and simplified accordingly.

PR-URL: https://github.com/nodejs/node/pull/12966
Fixes: https://github.com/nodejs/node/issues/12965
Refs: https://github.com/whatwg/url/pull/309
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-05-20 00:36:57 -07:00
Timothy Gu
841bb4c61f
url: fix C0 control and whitespace handling
PR-URL: https://github.com/nodejs/node/pull/12846
Fixes: https://github.com/nodejs/node/issues/12825
Refs: https://github.com/w3c/web-platform-tests/pull/5792
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-05-19 23:19:57 -07:00
Rich Trott
525497596a test: refactor test-net-GH-5504
* Improve comments describing test.
* Remove unnecessary `common.noop`
* Remove confusing scoping of `c` identifier

PR-URL: https://github.com/nodejs/node/pull/13025
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-05-19 21:42:52 -07:00
Rich Trott
658741b9d9 test: refactor test-https-set-timeout-server
* Add common.mustCall() for error handlers.
* Alphabetize modules

PR-URL: https://github.com/nodejs/node/pull/13032
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
2017-05-19 21:26:46 -07:00
Refael Ackermann
6bfdeedce5 async_wrap: add asyncReset to TLSWrap
When using an Agent for HTTPS, `TLSSocket`s are reused and need to
have the ability to `asyncReset` from JS.

PR-URL: https://github.com/nodejs/node/pull/13092
Fixes: https://github.com/nodejs/node/issues/13045
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-05-19 23:27:44 -04:00
Michael Dawson
4a7b7e8097 doc: add reference to node_api.h in docs
Realized that we don't actually point people to the file to
include in order to access N-API functions.  Add that.

PR-URL: https://github.com/nodejs/node/pull/13084
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-05-19 17:21:16 -04:00
Jason Ginchereau
a63b245b0a n-api: Retain last code when getting error info
Unlike most N-API functions, `napi_get_last_error_info()` should not
clear the last error code when successful, because a pointer to (not
a copy of) the error info structure is returned via an out parameter.

PR-URL: https://github.com/nodejs/node/pull/13087
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-05-19 17:04:02 -04:00
Michael Dawson
3702ae732e doc: add additional useful ci job to list
PR-URL: https://github.com/nodejs/node/pull/13086
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2017-05-19 17:01:08 -04:00
Refael Ackermann
fccc0bf6e6 test: add mustCallAtLeast
PR-URL: https://github.com/nodejs/node/pull/12935
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-05-19 15:22:44 -04:00
Ben Noordhuis
46e773c5db src: check if --icu-data-dir= points to valid dir
Call uc_init() after u_setDataDirectory() to find out if the data
directory is actually valid.

This commit removes parallel/test-intl-no-icu-data, added in commit
46345b9 ("src: make --icu-data-dir= switch testable").  It no longer
works now that an invalid --icu-data-dir= argument is rejected.
Coverage is now provided by parallel/test-icu-data-dir.

Fixes: https://github.com/nodejs/node/issues/13043
Refs: https://github.com/nodejs/node-gyp/issues/1199
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
2017-05-19 20:24:41 +02:00
Refael Ackermann
6f216710eb test: ignore spurious 'EMFILE'
According to the explanation in #3635#issuecomment-157714683
And as a continuation to #5422 we also ignore EMFILE
"No more file descriptors are available,so no more files can be opened"

PR-URL: https://github.com/nodejs/node/pull/12698
Fixes: https://github.com/nodejs/node/issues/10286
Refs: https://github.com/nodejs/node/issues/3635#issuecomment-157714683
Refs: https://github.com/nodejs/node/pull/5178
Refs: https://github.com/nodejs/node/pull/5179
Refs: https://github.com/nodejs/node/pull/4005
Refs: https://github.com/nodejs/node/pull/5121
Refs: https://github.com/nodejs/node/pull/5422
Refs: https://github.com/nodejs/node/pull/12621#issuecomment-297701459
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-05-19 12:07:10 -04:00
cjihrig
51664fc265 net: add symbol to normalized connect() args
This commit attaches a Symbol to the result of
net._normalizeArgs(). This prevents normal arrays from being
passed to the internal Socket.prototype.connect() bypass logic.

PR-URL: https://github.com/nodejs/node/pull/13069
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-05-19 11:22:40 -04:00
Artur Vieira
6b1819cff5 test: use dynamic port in test-cluster-dgram-reuse
Remove common.PORT from test-cluster-dgram-reuse to eliminate
possibility that a dynamic port used in another test will collide with
common.PORT.

PR-URL: https://github.com/nodejs/node/pull/12901
Ref: https://github.com/nodejs/node/issues/12376
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2017-05-19 15:44:18 +02:00
Rick Bullotta
847688018c
doc: don't suggest setEncoding for binary streams
Removed an incorrect reference to the use of setEncoding(null) as the
proper way to handling binary streams or to disable encoding, and
explained that the default encoding is "no encoding", and that this is
the correct approach for dealing with binary data via Buffers.

PR-URL: https://github.com/nodejs/node/pull/11363
Fixes: https://github.com/nodejs/node/issues/11352
Refs: https://github.com/nodejs/node/issues/11316
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-05-19 13:02:17 +01:00
Faiz Halde
eff9252181
doc: update doc of publicEncrypt method
As per https://github.com/nodejs/node/issues/12946
the crypto doc for publicEncrypt doesn't tell
you whether the encryption happens in place or not.

Fixes: https://github.com/nodejs/node/issues/12946
PR-URL: https://github.com/nodejs/node/pull/12947
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-05-19 12:45:32 +02:00
Michael Dawson
ab34f9dec2 doc: update doc to remove usage of "you"
As per style guide avoid the use of you, your etc.
Rational as per: http://www2.ivcc.edu/rambo/tip_formal_writing_voice.htm

PR-URL: https://github.com/nodejs/node/pull/13067
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-05-18 21:25:48 -04:00
Akshay Iyer
a593c74f81 test: refactor test-vm-new-script-new-context
Changed the second parameter of assert.throws to match the errors.

PR-URL: https://github.com/nodejs/node/pull/13035
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-05-18 17:01:55 -07:00
Daniel Bevenius
29d89c9855
src: split CryptoPemCallback into two functions
Currently the function CryptoPemCallback is used for two things:
1. As a passphrase callback.
2. To avoid the default OpenSSL passphrase routine.

The default OpenSSL passphase routine would apply if both
the callback and the passphrase are null pointers and the typical
behaviour is to prompt for the passphase which is not appropriate in
node.

This commit suggests that the PasswordCallback function only handle
passphrases, and that an additional function named NoPasswordCallback
used for the second case to avoid OpenSSL's passphase routine.

PR-URL: https://github.com/nodejs/node/pull/12827
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-05-18 23:54:31 +02:00
Rich Trott
7e5ed8bad9
test: track callback invocations
Use `common.mustCall()` and `common.mustNotCall()` to check that
callbacks are invoked the expected number of times in
test-net-listen-shared-ports.

PR-URL: https://github.com/nodejs/node/pull/13010
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-05-18 23:25:32 +02:00
Anna Henningsen
28ddac2ec2
buffer: fix indexOf for empty searches
Make searches for empty subsequences do exactly what
`String.prototype.indexOf()` does.

Fixes: https://github.com/nodejs/node/issues/13023
PR-URL: https://github.com/nodejs/node/pull/13024
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-05-18 23:16:40 +02:00
XadillaX
5a948f6f64
dns: fix crash using dns.setServers after resolve4
The callback function in cares_query is synchronous and called before
closed. So dns.setServers in the synchronous callback before closed will
occur crashing.

Fixes: https://github.com/nodejs/node/issues/894
Refs: https://github.com/nodejs/node/blob/v6.9.4/deps/cares/src/ares_process.c#L1332-L1333
Refs: https://github.com/OpenSIPS/opensips/blob/2.3.0/proxy.c
PR-URL: https://github.com/nodejs/node/pull/13050
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-05-18 23:09:08 +02:00
Rich Trott
47e3d00241
test: refactor test-dns-regress-6244.js
* Move from parallel to internet because it performs a DNS query
* Provide link to relevant issue in comments
* Remove unnecessary explicit no-op function

PR-URL: https://github.com/nodejs/node/pull/13058
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-05-18 23:02:31 +02:00
Frank Lanitz
5de722ab6d
doc: fix links from ToC to subsection for 4.8.x
PR-URL: https://github.com/nodejs/node/pull/13039
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-05-18 17:14:17 +01:00
Daniel Bevenius
6933419cb9 test: add hasCrypto to tls-lookup
Currently when building --without-ssl this test will report the
following error:
internal/util.js:82
    throw new Error('Node.js is not compiled with openssl crypto
support');

This commit adds a check for crypto and skips this test if node was
built without ssl support.

PR-URL: https://github.com/nodejs/node/pull/13047
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: David Cai <davidcai1993@yahoo.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-05-18 07:14:57 +02:00
Michael Dawson
0dd8b9a965 test: Improve N-API test coverage
- add coverage for napi_get_prototype
- add coverage for napi_strict_equals

PR-URL: https://github.com/nodejs/node/pull/13044
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jason Ginchereau <jasongin@microsoft.com>
2017-05-17 18:03:35 -04:00
Sam Roberts
d6cd466a25 src: whitelist new options for NODE_OPTIONS
Add --inspect-*, --napi-modules, --trace-event-categories

Remove --prof-process, like -p and -e, it causes node to do something
other than run node js scripts.

PR-URL: https://github.com/nodejs/node/pull/13002
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-05-17 12:40:17 -07:00
Joyee Cheung
6342988053 build: clean up napi build in test-addons-clean
PR-URL: https://github.com/nodejs/node/pull/13034
Ref: https://github.com/nodejs/node/issues/13031
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Rajaram Gaunker <rajarams@gmail.com>
2017-05-17 11:07:39 -04:00
Daniel Bevenius
5debcceafc test: add hasCrypto to tls-wrap-event-emmiter
Currently when building --without-ssl this test will report the
following error:
internal/util.js:82
    throw new Error('Node.js is not compiled with openssl crypto
support');

This commit adds a check for crypto and skips this test if node was
built without ssl support.

PR-URL: https://github.com/nodejs/node/pull/13041
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-05-17 12:50:04 +02:00
Daniel Bevenius
ad7b98baa8 build: don't print directory for GNUMake
Currently when running make targets the directory is printed on some
operating systems (Linux for example):

$ make lint
make[1]: Entering directory '/work/node'
Running JS linter...
./node tools/eslint/bin/eslint.js --cache --rulesdir=tools/eslint-rules
--ext=.js,.md \
  benchmark doc lib test tools
make[1]: Leaving directory '/work/node'
make[1]: Entering directory '/work/node'
Running C++ linter...

On other operating systems the directory is not printed. This commit
suggests adding a flag to make this consistent for GNUMake by not
printing the directory.

PR-URL: https://github.com/nodejs/node/pull/13042
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-05-17 12:34:41 +02:00