0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 23:43:09 +01:00
Commit Graph

12706 Commits

Author SHA1 Message Date
Roman Reiss
8b75030249 doc: fix rare case of misaligned columns
By using the same unit for the offset of the main column as used for the
left column width, we ensure that browsers render the columns
conistently.

Ref: https://github.com/nodejs/help/issues/32

PR-URL: https://github.com/nodejs/node/pull/3948
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-27 01:52:33 +01:00
Rich Trott
20acc60615 test: use platform-based timeout for reliability
test-http-client-timeout-with-data fails on Raspberry Pi in CI from time
to time.

Use a platform-based timeout to improve reliability.

PR-URL: https://github.com/nodejs/node/pull/4015
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-11-26 12:28:22 -08:00
cjihrig
459b106d6c repl: attach location info to syntax errors
Currently, when a file with a syntax error is imported in the
REPL, no information is provided on the error's location. This
commit adds the error's location to the stack trace.

Refs: https://github.com/nodejs/node/issues/2762
Refs: https://github.com/nodejs/node/issues/3411
Refs: https://github.com/nodejs/node/issues/3784
PR-URL: https://github.com/nodejs/node/pull/4013
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-11-25 13:34:13 -05:00
cjihrig
8ca412b7a3 util: add decorateErrorStack()
This commit adds the decorateErrorStack() method. This function
uses the internal util's getHiddenValue() method to extract
arrow messages from error objects and attach them to the
error's stack trace.

PR-URL: https://github.com/nodejs/node/pull/4013
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-11-25 13:28:06 -05:00
Rich Trott
16db4c4d5e test: mark cluster-net-send test flaky on windows
See https://github.com/nodejs/node/issues/3957 for details and examples
failures.

Ref: https://github.com/nodejs/node/issues/3957
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/nodejs/node/pull/4006
2015-11-25 09:57:19 -08:00
Rich Trott
fc47e0f8cb test: mark fork regression test flaky on windows
See https://github.com/nodejs/node/issues/3635 for details and failure
examples.

Ref: https://github.com/nodejs/node/issues/3635
PR-URL: https://github.com/nodejs/node/pull/4005
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-11-25 09:47:45 -08:00
Tom Gallacher
93739f48ff buffer: default to UTF8 in byteLength()
If an undefined encoding is passed to byteLength(),
assume that it is UTF8 immediately. This yields a
small speedup, as it prevents string operations on
the encoding argument.

PR-URL: https://github.com/nodejs/node/pull/4010
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-11-25 10:53:52 -05:00
Chunyang Dai
a881b53954 build,src: add Intel Vtune profiling support
This feature supports the Intel Vtune profiling support for JITted
JavaScript on IA32 / X64 / X32 platform. The advantage of this profiling
is that the user / developer of NodeJS application can get the detailed
profiling information for every line of the JavaScript source code.
This information will be very useful for the owner to optimize their
applications.

This feature is a compile-time option. For windows platform, the user
needs to pass the following parameter to vcbuild.bat: "enable-vtune"

For other OS, the user needs to pass the following parameter to
./configure command: "--enable-vtune-profiling"

PR-URL: https://github.com/nodejs/node/pull/3785
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-11-25 13:57:25 +01:00
Matt Loring
b2e7a4d479 installer: install the tick processor
The tick processor is used to provide readable profiling information
from isolate tick logs (produced by a call to node -prof).

This patch installs the file at $PREFIX/share/doc/node/tick-processor.

PR-URL: https://github.com/nodejs/node/pull/3032
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-11-25 13:56:21 +01:00
Michaël Zasso
ab25589f59 deps: backport 819b40a from V8 upstream
Original commit message:

    Use baseline code to compute message locations.

    This switches Isolate::ComputeLocation to use baseline code when
    computing message locations. This unifies locations between optimized
    and non-optimized code by always going through the FrameSummary for
    location computation.

    R=bmeurer@chromium.org
    TEST=message/regress/regress-4266
    BUG=v8:4266
    LOG=n

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

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

Fixes: https://github.com/nodejs/node/issues/3934
PR-URL: https://github.com/nodejs/node/pull/3937
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-11-25 10:47:51 +01:00
Rich Trott
b061e3af55 test: skip test if in FreeBSD jail
Test test-net-socket-local-address is flaky in FreeBSD jail but robust
otherwise.

Fixes: https://github.com/nodejs/node/issues/2475
PR-URL: https://github.com/nodejs/node/pull/3995
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-11-24 19:38:21 -08:00
Jan Schär
d7b199d9e3 net: add local address/port for better errors
Adds localAddress and localPort to req so we have better error messages.
Also fixes a case where ex is used before it is declared.

PR-URL: https://github.com/nodejs/node/pull/3946
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-11-24 16:00:51 -06:00
cjihrig
5169311bf9 util,src: allow lookup of hidden values
This commit adds an internal util method that makes hidden
values in the C++ layer visible in JS.

PR-URL: https://github.com/nodejs/node/pull/3988
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-11-24 15:49:50 -05:00
Rich Trott
658842280d test: remove flaky status for cluster test
The test did not fail after 9999 runs in continuous integration.

Remove it's flaky status.

Fixes: https://github.com/nodejs/node/issues/2557
PR-URL: https://github.com/nodejs/node/pull/3975
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
2015-11-24 20:14:10 +01:00
Bryan English
6f87aa9a12 doc: message.header duplication correction
The old version of the text here was slightly incorrect, so it
just defers the details to the section in which they're fully
described.

PR-URL: https://github.com/nodejs/node/pull/3997
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2015-11-24 16:16:01 +01:00
Rich Trott
41519fd1a4 test: add TAP diagnostic message for retried tests
Tests on SmartOS are sometimes retried due to a SmartOS issue on CI.
When this happens, a TAP diagnostic message is written.

PR-URL: https://github.com/nodejs/node/pull/3960
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-11-24 08:17:12 -08:00
Rich Trott
8d37bbe9e9 doc: fix typo in README
PR-URL: https://github.com/nodejs/node/pull/4000
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-11-24 11:13:22 -05:00
Bryon Leung
2ccde01980 src: add BE support to StringBytes::Encode()
Versions of Node.js after v0.12 have relocated byte-swapping away from
the StringBytes::Encode function, thereby causing a nan test (which
accesses this function directly) to fail on big-endian machines.

This change re-introduces byte swapping in StringBytes::Encode,
done via a call to a function in util-inl. Another change in
NodeBuffer::StringSlice was necessary to avoid double byte swapping
in big-endian function calls to StringSlice.

PR-URL: https://github.com/nodejs/node/pull/3410
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-11-24 15:26:23 +01:00
Rich Trott
8bc8038687 test: retry on smartos if ECONNREFUSED
SmartOS has a bug that causes unexpected ECONNREFUSED errors.

See https://smartos.org/bugview/OS-2767

If ECONNREFUSED on SmartOS, retry the test one time.

Fixes: https://github.com/nodejs/node/issues/3864
Fixes: https://github.com/nodejs/node/issues/2815
PR-URL: https://github.com/nodejs/node/pull/3941
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-11-23 12:21:10 -08:00
Rich Trott
487de19684 test: address flaky test-http-client-timeout-event
Use common.platformTimeout() to make test more reliable on Raspberry Pi.

Fixes: https://github.com/nodejs/node/issues/2555
PR-URL: https://github.com/nodejs/node/pull/3968

Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
2015-11-23 20:23:34 +01:00
Lewis Cowper
3becac2e60 doc: replace sane with reasonable
Removing ableist language because we don't need to make the comparison
to people with mental health issues to get our point across.

PR-URL: https://github.com/nodejs/node/pull/3980
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-11-23 14:47:55 +01:00
Tom Gallacher
d16def5326 doc: Adding best practises for crypto.pbkdf2
Added some information around usages of how to use iterations, how to
choose decent salts and updating the example to have a significant
work factor and to use sha512.

PR-URL: https://github.com/nodejs/node/pull/3290
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
2015-11-23 17:49:52 +09:00
Carl Lei
615fba3bcf doc: numeric flags to fs.open
This has been supperted for long but never tested nor documented.

PR-URL: https://github.com/nodejs/node/pull/3641
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-22 13:35:09 +01:00
Carl Lei
804cc7670d test: numeric flags to fs.open
This has been supperted for long but never tested nor documented.

PR-URL: https://github.com/nodejs/node/pull/3641
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-22 13:35:02 +01:00
Carl Lei
3f4409e571 doc: clarify that fs streams expect blocking fd
This clarifies that fs.createReadStream and fs.createWriteStream, when
passed a fd, expects the fd to be blocking, and suggests net.Socket as
an alternative.

PR-URL: https://github.com/nodejs/node/pull/3641
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-22 13:34:30 +01:00
Fedor Indutny
91ccbf0201 configure: v8_use_snapshot should be true
`v8_use_snapshot` should be either `true` or `false`, not 1 or 0.

PR-URL: https://github.com/nodejs/node/pull/3962
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
2015-11-21 21:15:11 -05:00
Ben Noordhuis
c83d9b7065 crypto: update root certificates
Update the list of root certificates in src/node_root_certs.h with
tools/mk-ca-bundle.pl.

PR-URL: https://github.com/nodejs/node/pull/3951
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-11-21 21:33:30 +01:00
Ben Noordhuis
8c4deff55d tools: update certdata.txt
This is the latest certdata.txt from [0], last updated on 2015-11-13.

[0] https://hg.mozilla.org/mozilla-central/raw-file/64df3815df9c/security/nss/lib/ckfw/builtins/certdata.txt

PR-URL: https://github.com/nodejs/node/pull/3951
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-11-21 21:33:01 +01:00
yorkie
8b97249893 fs: fix the error report on fs.link(Sync)
As the Node.js documentation specified:

> fs.link(srcpath, dstpath, callback)

But when we run:

```js
> fs.link()
```

We will get the below:

```js
TypeError: dest path must be a string
    at TypeError (native)
    at Object.fs.link (fs.js:915:11)
    at repl:1:4
```

Just correct the message of relevant 2 errors in this PR :-)

PR-URL: https://github.com/nodejs/node/pull/3917
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-20 16:09:09 -08:00
Jan Schär
9472a0cfad net: small code cleanup
`options` is already a param of the function.

PR-URL: https://github.com/nodejs/node/pull/3943
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-11-20 15:53:11 -08:00
Tristian Flanagan
dfee4e3712 module: fix column offsets in errors
Because Node modules are wrapped, errors on the first line
of a file leak the wrapper to the user and report the wrong
column number. This commit adds a line break to the module
wrapper so that the first line is treated the same as all
other lines. To compensate for the additional line, a line
offset of -1 is also applied to errors.

Fixes: https://github.com/nodejs/node/issues/2860
PR-URL: https://github.com/nodejs/node/pull/2867
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-11-20 16:26:24 -05:00
Alexander Gromnitsky
94c3507f5c doc: fix broken references
PR-URL: https://github.com/nodejs/node/pull/3944
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Myles Borins <mborins@us.ibm.com>
2015-11-20 11:52:23 -08:00
Matt Loring
22478d3669 buffer: move checkFloat from lib into src
The type and range checks performed by this function can be done more
efficiently in native code.

PR-URL: https://github.com/nodejs/node/pull/3763
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-20 12:23:05 -07:00
Martin Forsberg
55b1eccae6 doc: move fs.existsSync() deprecation message
This commit moves the deprecation message for fs.existsSync()
above the function description, making message placement
uniform across the documentation.

PR-URL: https://github.com/nodejs/node/pull/3942
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-11-20 14:11:02 -05:00
Bryan English
174d4e484e test: http complete list of non-concat headers
The original test was only testing some of the headers that shouldn't be
concatenated as per lib/_http_incoming.js, so now the full list is
there.

'content-length` gives a parse error if you set it to a string, so the
test for that header uses numbers.

PR-URL: https://github.com/nodejs/node/pull/3930
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-11-20 12:42:03 -05:00
Stefan Budeanu
56a2b9a246 crypto: disable crypto.createCipher in FIPS mode
FIPS 140-2 disallows use of MD5, which is used to derive the
initialization vector and key for createCipher(). Modify
all tests to expect exceptions in FIPS mode when disallowed
API is used, or to avoid testing such API in FIPS Mode.

PR-URL: https://github.com/nodejs/node/pull/3754
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-20 09:35:58 -08:00
Michael Cornacchia
6de82c69a0 test: fix race condition in unrefd interval test
Rely more on timers implementation rather than arbitrary timeouts.

Refs: https://github.com/nodejs/node/issues/1781
PR-URL: https://github.com/nodejs/node/pull/3550

Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-20 12:29:30 -05:00
Minwoo Jung
d01eb6882f lib: add 'pid' prefix in internal/util
This PR improves `prefix` in `util` that we've agreed on
https://github.com/nodejs/node/pull/3833
(separate code for javascript to move the printing function
to C++ directly)

PR-URL: https://github.com/nodejs/node/pull/3878
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>
2015-11-20 09:24:53 -08:00
cjihrig
ca2e8b292f readline: deprecate undocumented exports
This commit moves several of readline's undocumented functions
into an internal module. Specifically, isFullWidthCodePoint,
stripVTControlCharacters, getStringWidth, and emitKeys are
moved to the internal module. The existing public exports
of the first three functions are given a deprecation notice.

Refs: https://github.com/nodejs/node/pull/3847
Fixes: https://github.com/nodejs/node/issues/3836
PR-URL: https://github.com/nodejs/node/pull/3862
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2015-11-19 17:01:25 -05:00
Stefan Budeanu
e499ea849c test: skip/replace weak crypto tests in FIPS mode
FIPS 140-2 does not permit the use of MD5 and RC4, skip or tests
that use them, or substitute with stronger crypto where applicable.

PR-URL: https://github.com/nodejs/node/pull/3757
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: James Snell <jasnell@gmail.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
2015-11-19 16:31:11 -05:00
cjihrig
5900d14966 doc: clarify module loading behavior
The module loading system will not append node_modules to a
path already ending in node_modules. This used to be documented,
but it was lost.

Fixes: https://github.com/nodejs/node/issues/3873
PR-URL: https://github.com/nodejs/node/pull/3920
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2015-11-19 13:12:00 -05:00
cjihrig
5f3ed61094 doc: add reference for buffer.inspect()
This commit refers readers to util.inspect() for an explanation
of buffer.inspect().

Fixes: https://github.com/nodejs/node/issues/3918
PR-URL: https://github.com/nodejs/node/pull/3921
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2015-11-19 13:02:32 -05:00
Wyatt Preul
007cfea308 util: remove pump
Remove util.pump and associated tests

PR-URL: https://github.com/nodejs/node/pull/2531
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-18 14:28:35 -08:00
Wyatt Preul
a2c0aa84e0 tty: Remove deprecated setRawMode wrapper
PR-URL: https://github.com/nodejs/node/pull/2528
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-18 13:16:02 -08:00
Wyatt Preul
4cf19ad1bb util: Remove exec, has been deprecated for years
PR-URL: https://github.com/nodejs/node/pull/2530
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-18 13:04:16 -08:00
Stefan Budeanu
e4e5b13efd test: avoid test timeouts on rpi
Generating 1024-bit primes on rpi test machines sometimes
causes timeouts. Avoid this situation by using 256-bit
primes when not running in FIPS mode.

Fixes: https://github.com/nodejs/node/issues/3881
PR-URL: https://github.com/nodejs/node/pull/3902
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Ben Noordhuis <ben@strongloop.com>
2015-11-18 09:52:07 -08:00
Rich Trott
ac319c3547 test: fix flaky test-child-process-spawnsync-input
Move portion of `test-child-process-spawnsync-input.js` (that has been
flaky on CentOS in CI) to its own file. This allows us to more easily
eliminate the cause of the flakiness without affecting other unrelated
portions of the test.

Fixes: https://github.com/nodejs/node/issues/3863
PR-URL: https://github.com/nodejs/node/pull/3889
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-18 07:58:17 -08:00
yorkie
72e3dd9f43 process: throw on non-function to nextTick()
This commit causes process.nextTick() to throw when its callback
argument is not a function.

PR-URL: https://github.com/nodejs/node/pull/3860
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2015-11-18 10:52:01 -05:00
Evan Lucas
339d3840c8 test: add OS X to module loading error test
Previously, this test was not supported on OS X. This change makes sure
that it is no longer skipped.

PR-URL: https://github.com/nodejs/node/pull/3901
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-11-18 09:43:57 -06:00
fansworld-claudio
9a628e2dac test: module loading error fix solaris #3798
- refactor test to accept multiple error messages per platform
- add new message to be found in Solaris 11.3 as per #3798

PR-URL: https://github.com/nodejs/node/pull/3855
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2015-11-18 08:01:13 -06:00