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

13940 Commits

Author SHA1 Message Date
Rich Trott
153b796d68 doc: update build instructions for OS X
Building Node.js on OS X requires XCode (because node-gyp requires
XCode). Add that information to BUILDING.md.

Additionally, this changes references to `Macintosh` in BUILDING.md to
refer to `OS X`. This is consistent with the way other references are to
operating system families (`Unix`, `Windows`) and not brand names or
hardware architectures.

PR-URL: https://github.com/nodejs/node/pull/6309
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2016-04-28 10:09:59 -07:00
Brian White
be54989987
build: exclude tap files from tarballs
PR-URL: https://github.com/nodejs/node/pull/6348
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2016-04-28 11:26:36 -04:00
Matt Loring
89164a096d benchmark: Fix crash in net benchmarks
Net benchmarks create partial event emitters that do not have all of the
required event emitter functions. They currently mock out `on`, `once`,
and `emit` functions. This change mocks out `prependListener` as well to
avoid crashing in `_stream_readable`.

PR-URL: https://www.github.com/nodejs/node/pull/6407
Fixes: https://www.github.com/nodejs/node/issues/6405
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
Reviewed-By: Matthew Loring <mattloring@google.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-04-27 17:06:08 -07:00
Ben Noordhuis
3cdb5063f2 build: don't compile with -B
Turn off the custom toolchain, we don't bundle ld.gold.  It's not that
useful anyway because it uses a fixed path.  For people that do use a
custom toolchain, there is the GCC_EXEC_PREFIX environment variable.

PR-URL: https://github.com/nodejs/node/pull/6393
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-04-27 16:35:02 +02:00
Ben Noordhuis
428240519c test: check that 2nd handle.close() call is a nop
Verify that a second call to handle.close() is a no-op.

PR-URL: https://github.com/nodejs/node/pull/6395
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-04-27 16:27:30 +02:00
Ben Noordhuis
a58d4839af src: simplify handlewrap state tracking logic
This also updates the tests to expect that a closed handle has no
reference count.

PR-URL: https://github.com/nodejs/node/pull/6395
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-04-27 16:27:28 +02:00
Ben Noordhuis
cad1a62d32 src: use libuv's refcounting directly
Don't implement an additional reference counting scheme on top of libuv.
Libuv is the canonical source for that information so use it directly.

PR-URL: https://github.com/nodejs/node/pull/6395
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-04-27 16:26:05 +02:00
Lance Ball
23818c6d0b doc: correctly document the behavior of ee.once().
Addresses #5566. The `ee.once()` function is currently documented as
invoking the listener, and then removing it when the event is
triggered. However, this is not really the case. The listener is removed
and _then_ invoked. This only matters in a narrow set of use cases, but
when it matters, it matters that the docs are correct.

See the issue (#5566) for a discussion on why the code has not been
modified to match the documentation, but instead the documentation has
been modified to match the code.

Fixes: https://github.com/nodejs/node/issues/5566
PR-URL: https://github.com/nodejs/node/pull/6371
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Robert Lindstaedt <robert.lindstaedt@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
2016-04-26 22:49:37 -07:00
Bryan English
31bef6b704 http: correct error message for invalid trailer
Prevent misleading error messages when trailers are invalid.

PR-URL: https://github.com/nodejs/node/pull/6308
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Brian White <mscdex@mscdex.net>
2016-04-26 22:38:29 -07:00
Jackson Tian
e556dd3856 doc: use Buffer.from() instead of new Buffer()
Use new API of Buffer to developers in most documents.

PR-URL: https://github.com/nodejs/node/pull/6367
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
2016-04-27 13:23:41 +08:00
Fedor Indutny
cee4c25c92 net: introduce Socket#connecting property
There is no official way to figure out if the socket that you have on
hand is still connecting to the remote host. Introduce
`Socket#connecting`, which is essentially an unprefixed `_connecting`
property that we already had.

PR-URL: https://github.com/nodejs/node/pull/6404
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2016-04-27 00:41:15 -04:00
Myles Borins
cc5d9767af meta: split CHANGELOG into two files
The unfortunate has happened, our CHANGELOG is now over 1 MB and cannot
be viewed on github. This commit breaks the CHANGELOG into two files
so that we can continue to show our changes rendered in the github UI.

Closes: https://github.com/nodejs/node/issues/5533

PR-URL: https://github.com/nodejs/node/pull/6337
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Roman Reiss <me@silverwind.io>
2016-04-26 13:16:01 -07:00
James M Snell
1a29a5773a 2016-04-26, Version 6.0.0 (Current) Release
The following significant (semver-major) changes have been made since the
previous Node v5.0.0 release.

* Buffer
  * New Buffer constructors have been added
    [#4682](https://github.com/nodejs/node/pull/4682)
  * Previously deprecated Buffer APIs are removed
    [#5048](https://github.com/nodejs/node/pull/5048),
    [#4594](https://github.com/nodejs/node/pull/4594)
  * Improved error handling [#4514](https://github.com/nodejs/node/pull/4514)
* Cluster
  * Worker emitted as first argument in 'message' event
    [#5361](https://github.com/nodejs/node/pull/5361).
* Crypto
  * Improved error handling [#3100](https://github.com/nodejs/node/pull/3100),
    [#5611](https://github.com/nodejs/node/pull/5611)
  * Simplified Certificate class bindings
    [#5382](https://github.com/nodejs/node/pull/5382)
  * Improved control over FIPS mode
    [#5181](https://github.com/nodejs/node/pull/5181)
  * pbkdf2 digest overloading is deprecated
    [#4047](https://github.com/nodejs/node/pull/4047)
* Dependencies
  * Reintroduce shared c-ares build support
    [#5775](https://github.com/nodejs/node/pull/5775).
  * V8 updated to 5.0.71.31 [#6111](https://github.com/nodejs/node/pull/6111).
* DNS
  * Add resolvePtr API to query plain DNS PTR records
    [#4921](https://github.com/nodejs/node/pull/4921).
* Domains
  * Clear stack when no error handler
  [#4659](https://github.com/nodejs/node/pull/4659).
* File System
  * The `fs.realpath()` and `fs.realpathSync()` methods have been updated
    to use a more efficient libuv implementation. This change includes the
    removal of the `cache` argument and the method can throw new errors
    [#3594](https://github.com/nodejs/node/pull/3594)
  * FS apis can now accept and return paths as Buffers
    [#5616](https://github.com/nodejs/node/pull/5616).
  * Error handling and type checking improvements
    [#5616](https://github.com/nodejs/node/pull/5616),
    [#5590](https://github.com/nodejs/node/pull/5590),
    [#4518](https://github.com/nodejs/node/pull/4518),
    [#3917](https://github.com/nodejs/node/pull/3917).
  * fs.read's string interface is deprecated
    [#4525](https://github.com/nodejs/node/pull/4525)
* HTTP
  * 'clientError' can now be used to return custom errors from an
    HTTP server [#4557](https://github.com/nodejs/node/pull/4557).
* Modules
  * Current directory is now prioritized for local lookups
    [#5689](https://github.com/nodejs/node/pull/5689)
  * Symbolic links are preserved when requiring modules
    [#5950](https://github.com/nodejs/node/pull/5950)
* Net
  * DNS hints no longer implicitly set
    [#6021](https://github.com/nodejs/node/pull/6021).
  * Improved error handling and type checking
    [#5981](https://github.com/nodejs/node/pull/5981),
    [#5733](https://github.com/nodejs/node/pull/5733),
    [#2904](https://github.com/nodejs/node/pull/2904)
* OS X
  * MACOSX_DEPLOYMENT_TARGET has been bumped up to 10.7
    [#6402](https://github.com/nodejs/node/pull/6402).
* Path
  * Improved type checking [#5348](https://github.com/nodejs/node/pull/5348).
* Process
  * Introduce process warnings API
    [#4782](https://github.com/nodejs/node/pull/4782).
  * Throw exception when non-function passed to nextTick
    [#3860](https://github.com/nodejs/node/pull/3860).
* Readline
  * Emit key info unconditionally
    [#6024](https://github.com/nodejs/node/pull/6024)
* REPL
  * Assignment to `_` will emit a warning.
    [#5535](https://github.com/nodejs/node/pull/5535)
* Timers
  * Fail early when callback is not a function
    [#4362](https://github.com/nodejs/node/pull/4362)
* TLS
  * Rename 'clientError' to 'tlsClientError'
    [#4557](https://github.com/nodejs/node/pull/4557)
  * SHA1 used for sessionIdContext
    [#3866](https://github.com/nodejs/node/pull/3866)
* TTY
  * Previously deprecated setRawMode wrapper is removed
    [#2528](https://github.com/nodejs/node/pull/2528).
* Util
  * Changes to Error object formatting
    [#4582](https://github.com/nodejs/node/pull/4582).
* Windows
  * Windows XP and Vista are no longer supported
    [#5167](https://github.com/nodejs/node/pull/5167),
    [#5167](https://github.com/nodejs/node/pull/5167).
2016-04-26 13:05:32 -07:00
Сковорода Никита Андреевич
204f3a8a0b build: Bump MACOSX_DEPLOYMENT_TARGET to 10.7
Refs: https://github.com/nodejs/build/issues/367

libuv is going to drop 10.6 in v2.
Ref: https://github.com/libuv/libuv/pull/758

OS X versions below 10.9 are not supported by Apple anymore and do not
receive security patches.

PR-URL: https://github.com/nodejs/node/pull/6402
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
2016-04-26 10:17:27 -07:00
Сковорода Никита Андреевич
dd67608bfd buffer: safeguard against accidental kNoZeroFill
This makes sure that `kNoZeroFill` flag is not accidentally set by
moving the all the flag operations directly inside `createBuffer()`.
It safeguards against logical errors like
https://github.com/nodejs/node/issues/6006.

This also ensures that `kNoZeroFill` flag is always restored to 0 using
a try-finally block, as it could be not restored to 0 in cases of failed
or zero-size `Uint8Array` allocation.
It safeguards against errors like
https://github.com/nodejs/node/issues/2930.
It also makes the `size > 0` check not needed there.

PR-URL: https://github.com/nodejs/node-private/pull/30
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-04-26 10:04:35 -07:00
Jeremiah Senkpiel
2011f2c6dc doc: fix position of fs.readSync()
PR-URL: https://github.com/nodejs/node/pull/6399
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-04-26 12:55:56 -04:00
Myles Borins
29a6c7c1f0 doc: change references to Stable to Current
With v6 we plan to rename the Stable release line to Current.
This commit updates all references to Stable in the codebase. It will
have to land along side updates to other repos within the org.

Refs: https://github.com/nodejs/nodejs.org/issues/669
PR-URL: https://github.com/nodejs/node/pull/6318
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2016-04-26 09:52:44 -07:00
James M Snell
a026cd0fa5 doc: update authors
~116 new contributors since this was last updated!

PR-URL: https://github.com/nodejs/node/pull/6373
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
2016-04-26 09:50:21 -07:00
Yuval Brik
31de5cc436 doc, tls: deprecate createSecurePair
createSecurePair uses tls_legacy and the legacy Connection from
node_crypto.cc. Deprecate them in favor of TLSSocket.

PR-URL: https://github.com/nodejs/node/pull/6063
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-04-26 09:05:12 -07:00
Stefan Budeanu
56b9478f53 crypto: Read OpenSSL config before init
The OpenSSL configuration file allows custom crypto engines but those
directives will not be respected if the config file is loaded after
initializing all crypto subsystems. This patch reads the configuration
file first.

PR-URL: https://github.com/nodejs/node/pull/6374
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-04-26 08:51:29 -07:00
Jackson Tian
92a02d51dc doc: add JacksonTian to collaborators
Added myself as a collaborator following the onboarding process.

PR-URL: https://github.com/nodejs/node/pull/6388
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
2016-04-26 14:57:52 +08:00
Minqi Pan
879aeb5e49 doc: add Minqi Pan to collaborators
Also changed alias P.S.V.R to Minqi Pan.

Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/6387
2016-04-26 14:24:21 +08:00
Robert Jefe Lindstaedt
be5d699055
doc: add eljefedelrodeodeljefe to collaborators
PR-URL: #6389
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2016-04-26 08:11:59 +02:00
ronkorving
916b1a1d44 doc: add ronkorving to collaborators
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Rich Trott <rtrott@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/6385
2016-04-26 14:23:25 +09:00
Alexander Makarenko
c7066fb853 doc: add estliberitas to collaborators
PR-URL: https://github.com/nodejs/node/pull/6386
Reviewed-By: Johan Bergström <bugs@bergstroemnu>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2016-04-26 07:22:07 +02:00
surya panikkal
0303a2552e
readline: allow history to be disabled
1.  The `historySize` to default to `30` only if `undefined`.
2.  If `historySize` is set to 0, then disable caching the line.
3.  Added unit tests.
4.  Updated documentation.

Fixes: https://github.com/nodejs/node/issues/6336
PR-URL: https://github.com/nodejs/node/pull/6352
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-04-26 02:31:05 +02:00
Evan Lucas
4f619bde4c cluster: migrate from worker.suicide
Replace it with worker.exitedAfterDisconnect. Print deprecation
message when getting or setting until it is removed.

PR-URL: https://github.com/nodejs/node/pull/3743
Fixes: https://github.com/nodejs/node/issues/3721
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2016-04-25 19:24:37 -05:00
Jeremiah Senkpiel
9bb5a5e2a1 handle_wrap: IsRefed -> Unrefed, no isAlive check
This fixes my perceived usability issues with 7d8882b. Which, at the
time of writing, has not landed in any release except v6 RCs. This
should not be considered a breaking change due to that.

It is useful if you have a handle, even if it has been closed, to be
able to inspect whether that handle was unrefed or not. As such, this
renames the method accordingly. If people need to check a handle's
aliveness, that is a separate API we should consider exposing.

Refs: https://github.com/nodejs/node/pull/5834
PR-URL: https://github.com/nodejs/node/pull/6204
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-04-25 18:17:40 -04:00
Alex Kocharin
eb4201f07a url: drop auth in url.resolve() if host changes
Fixes: https://github.com/nodejs/node/issues/1435
PR-URL: https://github.com/nodejs/node/pull/1480
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2016-04-25 10:39:10 -07:00
Anna Henningsen
3ee68f794f repl: don’t complete expressions when eval fails
Instead of changing the way “simple” expressions are detected,
switch to ignoring errors when completing. This approach is more
generic than the previous one from 0b66b8f2d, but also changes
the way errors are thrown when completing.

This reverts the code changes from commit 0b66b8f2d2.
The test case is left intact.

Fixes: https://github.com/nodejs/node/issues/6325
PR-URL: https://github.com/nodejs/node/pull/6328
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-04-25 09:40:55 -07:00
Ali Ijaz Sheikh
e5f1e2c1df deps: upgrade to V8 5.0.71.35
Pick up the latest bug fix from the V8 5.0 branch.

Original commit message:
V8-Commit: https://github.com/v8/v8/commit/c1d51c7c
  Version 5.0.71.35 (cherry-pick)

  Merged 2837cb387

  disallow left-trim fast path when sampling heap profiler is active

  R=hablich@chromium.org, hpayer@chromium.org
  BUG=v8:4937

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

PR-URL: https://github.com/nodejs/node/pull/6372
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2016-04-25 09:29:26 -07:00
Alex Lamar
de1dc0ae2e module: preserve symlinks when requiring
Currently, required modules use the real location of the
package/file as their __filename and __dirname, instead
of the symlinked path if it exists. This behaviour is
undocumented (it even goes against documentation in
certain scenarios), creating hard-to-debug problems
for developers who wish to leverage filesystem abstractions
to lay out their application.

This patch resolves all required modules to their canonical
path while still preserving any symlinks within the path,
instead of resolving to their canonical realpath. The one
special case observed is when the main module is loaded
-- in this case, the realpath does need to be used
in order for the main module to load properly.

PR-URL: https://github.com/nodejs/node/pull/5950
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-04-25 09:24:52 -07:00
Jackson Tian
236b7e8dd1 doc: doc-only deprecation for util.log()
There are more powerful loggers in user land like `debug`, soft
deprecate it.

PR-URL: https://github.com/nodejs/node/pull/6161
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2016-04-25 08:39:22 -07:00
Eugene Obrezkov
1c84579031 console: timeEnd() with no label emits warning
When timeEnd() provided with label that doesn't exists
it emits warning in the console, so developer get know about it.

PR-URL: https://github.com/nodejs/node/pull/5901
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2016-04-25 08:28:23 -07:00
dcposch@dcpos.ch
6c1e5ad3ab buffer: add Buffer.prototype.lastIndexOf()
* Remove unnecessary templating from SearchString

  SearchString used to have separate PatternChar and SubjectChar template type
  arguments, apparently to support things like searching for an 8-bit string
  inside a 16-bit string or vice versa. However, SearchString is only used from
  node_buffer.cc, where PatternChar and SubjectChar are always the same. Since
  this is extra complexity that's unused and untested (simplifying to a single
  Char template argument still compiles and didn't break any unit tests), I
  removed it.

* Use Boyer-Hoore[-Horspool] for both indexOf and lastIndexOf

  Add test cases for lastIndexOf. Test the fallback from BMH to
  Boyer-Moore, which looks like it was totally untested before.

* Extra bounds checks in node_buffer.cc

* Extra asserts in string_search.h

* Buffer.lastIndexOf: clean up, enforce consistency w/ String.lastIndexOf

* Polyfill memrchr(3) for non-GNU systems

PR-URL: https://github.com/nodejs/node/pull/4846
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-04-25 08:24:28 -07:00
Brian White
d5922bd7a9
querystring: fix comments
PR-URL: https://github.com/nodejs/node/pull/6365
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2016-04-25 09:56:52 -04:00
Sakthipriyan Vairamani
2c480bdae6 src: fix check-imports.py linter errors
This patch fixes all the linter errors.

PR-URL: https://github.com/nodejs/node/pull/6105
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-04-25 19:24:27 +05:30
Sakthipriyan Vairamani
6781d917f4 tools: rewrite check-install.sh in python
As it is, check-install.sh does not show more helpful error messages,
and supporting various shells could be a problem. This patch rewrites
the same in Python.

This patch also enables check-imports.py in the linting process

PR-URL: https://github.com/nodejs/node/pull/6105
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-04-25 19:22:50 +05:30
Michael Dawson
75e073f2b2 test: increase the platform timeout for AIX
There have been failures on AIX due to the slower
default loopback performance. So far I've resisted
updating the global timeout but seeing another
new failure in a newly added test I now think the
right thing is to just extend the platform
timeout for AIX. This commit does that.

PR-URL: https://github.com/nodejs/node/pull/6342
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2016-04-25 09:09:52 -04:00
Johan Bergström
f1294f5bfd
gyp: inherit parent for *.host
Gyp defaults to gcc/g++ if CC.host/CXX.host is unset. This is not
suitable for environments that only uses the clang toolchain.

Since we already assume that the user will provide clang/clang++
through CC/CXX, lean against it (then drop to gcc/g++).

Also apply the same logic for link/ar for consistency although
it doesn't affect us.

PR-URL: https://github.com/nodejs/node/pull/6173
Fixes: https://github.com/nodejs/node/issues/6152
Reviewed-By: João Reis <reis@janeasystems.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-04-24 11:01:21 +10:00
Alexander Gromnitsky
983a809456 doc: fix broken references
PR-URL: https://github.com/nodejs/node/pull/6350
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
2016-04-22 19:08:48 -07:00
Ben Noordhuis
7940ecfa00 v8: warn in Template::Set() on improper use
The next major release will make it a fatal error to use non-primitive
values in function templates and object templates.

Print a warning that includes the C and JS stack trace to tell people to
upgrade their add-ons.  The C stack trace is only printed on platforms
that support it (the BSDs, OS X and Linux+glibc.)

The warning can be disabled with the new `--nowarn_template_set` flag.

Refs: https://github.com/nodejs/node/issues/6216
PR-URL: https://github.com/nodejs/node/pull/6277
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-04-22 23:48:31 +02:00
Rich Trott
e84c69310f tools: enforce deepStrictEqual over deepEqual
Introduce a lint rule that enforces use of `assert.deepStrictEqual()`
over `assert.deepEqual()`.

PR-URL: https://github.com/nodejs/node/pull/6213
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-04-22 14:39:53 -07:00
Rich Trott
a7335bd1f0 test,benchmark: use deepStrictEqual()
In preparation for a lint rule that will enforce
assert.deepStrictEqual() over assert.deepEqual(), change tests and
benchmarks accordingly. For tests and benchmarks that are testing or
benchmarking assert.deepEqual() itself, apply a comment to ignore the
upcoming rule.

PR-URL: https://github.com/nodejs/node/pull/6213
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-04-22 14:38:09 -07:00
Ben Noordhuis
5eb4ec090d src: squelch -Wunused-variable in non-icu builds
Silence the following compiler warning when building without ICU:

    ../src/node_config.cc:32:16: warning: unused variable 'env'
    [-Wunused-variable]
       Environment* env = Environment::GetCurrent(context);

PR-URL: https://github.com/nodejs/node/pull/6351
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-04-22 23:01:44 +02:00
Robert Chiras
a4b8000029 build: update android-configure script for npm
Now, that we can cross-compile node for Android, we also need to take
care of native node modules installed with npm. Since there is no way to
install and run npm on an Android device, we could instal node on host
and setup an environment for installing node modules and cross-compile
the native sources using Android NDK.
The changes to this script will allow npm, when installing a module, to
compile it using NDK.

In order to do this, the developer should do the following steps:
1. Compile and install node on host, using: configure, make and make
install
2. Build node for Android, using: source android-configure <path_to_ndk>
arch and make
3. Push node binary to Android device
4. Using the same session, configure npm arch using: npm config set
arch=<arch>
5. Install desired node modules using: npm install
6. Push installed node modules to Android device

Signed-off-by: Robert Chiras <robert.chiras@intel.com>
PR-URL: https://github.com/nodejs/node/pull/6349
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-04-22 22:12:53 +02:00
Robert Jefe Lindstaedt
ae991e7577 doc: add note for platform specific flags fs.open()
Note describing platform specific differences in fs.open

E.g. fs.open('<directory>', 'a+', console.log)

Fixes: https://github.com/nodejs/node/issues/3643
PR-URL: https://github.com/nodejs/node/pull/6136
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-04-22 11:32:22 -07:00
Anna Henningsen
a3b5b9cbf2
src: fix out-of-bounds write in TwoByteValue
Plan 2 bytes instead of 1 byte for the final zero terminator
for UTF-16. This is unlikely to cause real-world problems,
but that ultimately depends on the `malloc` implementation.

The issue can be uncovered by running e.g.
`valgrind node -e "Buffer(65536).fill('a'.repeat(4096), 'utf16le')"`

Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/nodejs/node/pull/6330
2016-04-22 20:28:53 +02:00
James M Snell
0e7d57af35 events: add prependListener() and prependOnceListener()
A handful of modules (including readable-streams) make
inappropriate use of the internal _events property. One
such use is to prepend an event listener to the front
of the array of listeners.

This adds EE.prototype.prependListener() and
EE.prototype.prependOnceListener() methods to add handlers
to the *front* of the listener array.

Doc update and test case is included.

Fixes: https://github.com/nodejs/node/issues/1817
PR-URL: https://github.com/nodejs/node/pull/6032
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2016-04-22 09:28:37 -07:00
Alexander Makarenko
f85412d49b doc: improvements to child_process, process docs
Sort links in lexical order. Add missing links.
Add `disconnect` event description in Process doc.
Fix typos.

R-URL: https://github.com/nodejs/node/pull/5075
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Robert Jefe Lindstädt <robert.lindstaedt@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2016-04-22 08:38:15 -07:00