Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Sync to nodejs/master (2016-04-27) #66

Merged
merged 144 commits into from
May 2, 2016
Merged

Conversation

jianchun
Copy link

Sync to nodejs/master as of 2016-04-27. Resolved a few merge conflicts, updated 7 message test baselines. Remained ~15 outstanding unit test failures.

zkat and others added 30 commits April 14, 2016 12:22
PR-URL: nodejs/node#6153
Reviewed-By: Jeremiah Senkpiel <[email protected]>
* Pick up the branch head for V8 5.0 stable [1]
* Edit v8 gitignore to allow trace_event copy
* Update V8 DEP trace_event as per deps/v8/DEPS [2]

[1] https://chromium.googlesource.com/v8/v8.git/+/3c67831
[2] https://chromium.googlesource.com/chromium/src/base/trace_event/common/+/4b09207e447ae5bd34643b4c6321bee7b76d35f9

Ref: nodejs/node#5945
PR-URL: nodejs/node#6111
Reviewed-By: targos - Michaël Zasso <[email protected]>
Reviewed-By: bnoordhuis - Ben Noordhuis <[email protected]>
Reviewed-By: indutny - Fedor Indutny <[email protected]>
V8 5.0 introduced a small modification for the unexpected end of input
error.

PR-URL: nodejs/node#5945
Reviewed-By: bnoordhuis - Ben Noordhuis <[email protected]>
Reviewed-By: indutny - Fedor Indutny <[email protected]>
PR-URL: nodejs/node#6090
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: bnoordhuis - Ben Noordhuis <[email protected]>
Reviewed-By: Myles Borins <[email protected]>
Reviewed-By: Claudio Rodriguez <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Fixes: nodejs/node#2895
This commit improves module loading performance by at least ~25-35%
in the module-loader benchmarks.

Some optimization strategies include:
* Try-finally/try-catch isolation
* Replacing regular expressions with manual parsing
* Avoiding unnecessary string and array creation
* Avoiding constant recompilation of anonymous functions and
function definitions within functions

PR-URL: nodejs/node#5172
Reviewed-By: James M Snell <[email protected]>
Though not a POSIX signal, SIGINFO is supported by BSD systems
(including Mac OS X) and is amongst the few signals that can be
triggered in a terminal via a simple key combination (CTRL-T).

On Linux, SIGINFO is an alias for SIGPWR; hence the defensive
conditionals in src/node.cc.

PR-URL: nodejs/node#6093
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
The debugger tests in parallel fail with `make test` sometimes (all the
time?). This appears to be related to running in parallel, as it does
not fail with `make test-ci`, when run via `tools/test.py` or directly
from the command line with `./node
test/parallel/test-debugger-util-regression.js`.

A separate issue may be opened to find out why it is failing in
parallel, but for now, I think it's important to fix `make test`
promptly.

I suspect the issue is that the tests are relying on a default port
somewhere and so they are colliding when run in parallel. But that's
just a guess for the moment.

PR-URL: nodejs/node#6205
Fixes: nodejs/node#6201
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Johan Bergström <[email protected]>
This commit switches from the eslint command-line tool to a custom
tool that uses eslint programmatically in order to perform linting
in parallel and to display linting results incrementally instead of
buffering them until the end.

Fixes: nodejs/node#5596
PR-URL: nodejs/node#5638
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Johan Bergström <[email protected]>
Remove realpath() and realpathSync() cache.
Use the native uv_fs_realpath() which is faster
then the JS implementation by a few orders of magnitude.

PR-URL: nodejs/node#3594
Reviewed-By: Trevor Norris <[email protected]>
Reviewed-By: Brian White <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Johan Bergström <[email protected]>
Aligns the functionality of SlowBuffer with the new Buffer
constructor API. Next step is to docs-only deprecate
SlowBuffer.

Replace the internal uses of SlowBuffer with
`Buffer.allocUnsafeSlow(size)`

PR-URL: nodejs/node#5833
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
Reviewed-By: Trevor Norris <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
With the addition of `Buffer.allocUnsafeSlow(size)`
`SlowBuffer` can be deprecated... but docs-only for now.

PR-URL: nodejs/node#5833
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
Reviewed-By: Trevor Norris <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
PR-URL: nodejs/node#5833
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
Reviewed-By: Trevor Norris <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
PR-URL: nodejs/node#6224
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Myles Borins <[email protected]>
PR-URL: nodejs/node#6225
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Myles Borins <[email protected]>
PR-URL: nodejs/node#6226
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
PR-URL: nodejs/node#6227
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Myles Borins <[email protected]>
Do to various reasons, outlined in the committed document, domains were
only in core for 2 years before being deprecated. This outline explains
why they received criticism from the community and never gained traction
with module authors.

Also included is an example script that accompanies the postmortem
analysis.

PR-URL: nodejs/node#6159
Reviewed-By: Robert Lindstädt <[email protected]>
Reviewed-By: Kelvin Knighton <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Brian White <[email protected]>
Run tests in parallel if the environment variable JOBS
(which should contain a number of parallel jobs) is set.

PR-URL: nodejs/node#6208
Reviewed-By: Rod Vagg <[email protected]>
Reviewed-By: Myles Borins <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Up to now, `Z_FINISH` was always the flushing flag that was used
for the last chunk of input data. This patch makes this choice
configurable so that advanced users can perform e.g. decompression of
partial data using `Z_SYNC_FLUSH`, if that suits their needs.

Add tests to make sure that an error is thrown upon encountering
invalid `flush` or `finishFlush` flags.

Fixes: nodejs/node#5761
PR-URL: nodejs/node#6069
Reviewed-By: James M Snell <[email protected]>
Some vm tests are not in strict mode because they need to create and use
global variables. By using `global.foo` instead of just `foo`, we can
still enable strict mode.

PR-URL: nodejs/node#6209
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Santiago Gimeno <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
V8 is going to disallow non-primitive values on v8::FunctionTemplate
and v8::ObjectTemplate because those can't be shared across contexts.

Fixes: nodejs/node#6216
PR-URL: nodejs/node#6228
Reviewed-By: Trevor Norris <[email protected]>
Run the debugger with `--port=common.PORT` to avoid the use of the same
port.

PR-URL: nodejs/node#6246
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
On Linux and OS X systems, `fs.watch()` resolves the watched path to an
inode. This clarifies that `fs.watch()` watches the inode and not the
path. If the inode of the path subsequently changes, `fs.watch()` will
continue watching the original inode and events for the path will no
longer be emitted. This is expected behavior.

Fixes: nodejs/node#5039
PR-URL: nodejs/node#6099
Reviewed-By: James M Snell <[email protected]>
Also add `EvalError`, `RangeError`, `ReferenceError`, `SyntaxError`,
`TypeError`, `URIError` to list of global types. Fix errors.markdown
copy accordingly.

Fixes: nodejs/node#5325.
PR-URL: nodejs/node#5329
Reviewed-By: James M Snell <[email protected]>
The message argument for `assert.fail()` is the third argument, not the
first. Correct minor misuse in internal module.

PR-URL: nodejs/node#6211
Reviewed-By: Brian White <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Original commit message:

     Improved diagnostic message for JS heap out of memory

     This patch replaces the unused 'take_snapshot' parameter on
     FatalProcessOutOfMemory() with a 'is_heap_oom' parameter.
     The parameter is set to true on error paths where the
     JS heap is out of memory, as distinct from a malloc()
     failure i.e. process out of memory.  The message output to
     stderr or passed to embedding applications via FatalErrorCallback
     is 'Javascript heap out of memory' rather than
     'process out of memory'.

     BUG=

     [email protected], [email protected], [email protected]

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

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

We'd like this in 6.x to help with diagnosing customer problems.
It provides a better message on OOM so that it is easier to
be able to tell whether the OOM was due to heap exhaustion
or running out of native memory.

PR-URL: nodejs/node#6218
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Moving the `message` event listener from the cluster object to each
worker object allows easier backporting of the recent jslint
changes since v5.x and older do not have v6.x's `worker` parameter
in the cluster object's `message` event.

PR-URL: nodejs/node#6212
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Clarify in docs for require.cache that reloading native modules
isn't supported.

Related: #6160
PR-URL: nodejs/node#6168
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Brian White <[email protected]>
Reviewed-By: James M Snell <[email protected]>
suryagh and others added 23 commits April 26, 2016 02:31
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: nodejs/node#6336
PR-URL: nodejs/node#6352
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
PR-URL: nodejs/node#6386
Reviewed-By: Johan Bergström <bugs@bergstroemnu>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Johan Bergström <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
PR-URL: nodejs/node#6385
PR-URL: #6389
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Santiago Gimeno <[email protected]>
Also changed alias P.S.V.R to Minqi Pan.

Reviewed-By: Johan Bergström <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
PR-URL: nodejs/node#6387
Added myself as a collaborator following the onboarding process.

PR-URL: nodejs/node#6388
Reviewed-By: Johan Bergström <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
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: nodejs/node#6374
Reviewed-By: Fedor Indutny <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: James M Snell <[email protected]>
createSecurePair uses tls_legacy and the legacy Connection from
node_crypto.cc. Deprecate them in favor of TLSSocket.

PR-URL: nodejs/node#6063
Reviewed-By: James M Snell <[email protected]>
~116 new contributors since this was last updated!

PR-URL: nodejs/node#6373
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
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: nodejs/nodejs.org#669
PR-URL: nodejs/node#6318
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
PR-URL: nodejs/node#6399
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Brian White <[email protected]>
Reviewed-By: James M Snell <[email protected]>
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
nodejs/node#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
nodejs/node#2930.
It also makes the `size > 0` check not needed there.

PR-URL: nodejs-private/node-private#30
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trevor Norris <[email protected]>
Refs: nodejs/build#367

libuv is going to drop 10.6 in v2.
Ref: libuv/libuv#758

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

PR-URL: nodejs/node#6402
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Fedor Indutny <[email protected]>
Reviewed-By: Myles Borins <[email protected]>
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](nodejs/node#4682)
  * Previously deprecated Buffer APIs are removed
    [#5048](nodejs/node#5048),
    [#4594](nodejs/node#4594)
  * Improved error handling [#4514](nodejs/node#4514)
* Cluster
  * Worker emitted as first argument in 'message' event
    [#5361](nodejs/node#5361).
* Crypto
  * Improved error handling [#3100](nodejs/node#3100),
    [#5611](nodejs/node#5611)
  * Simplified Certificate class bindings
    [#5382](nodejs/node#5382)
  * Improved control over FIPS mode
    [#5181](nodejs/node#5181)
  * pbkdf2 digest overloading is deprecated
    [#4047](nodejs/node#4047)
* Dependencies
  * Reintroduce shared c-ares build support
    [#5775](nodejs/node#5775).
  * V8 updated to 5.0.71.31 [#6111](nodejs/node#6111).
* DNS
  * Add resolvePtr API to query plain DNS PTR records
    [#4921](nodejs/node#4921).
* Domains
  * Clear stack when no error handler
  [#4659](nodejs/node#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](nodejs/node#3594)
  * FS apis can now accept and return paths as Buffers
    [#5616](nodejs/node#5616).
  * Error handling and type checking improvements
    [#5616](nodejs/node#5616),
    [#5590](nodejs/node#5590),
    [#4518](nodejs/node#4518),
    [#3917](nodejs/node#3917).
  * fs.read's string interface is deprecated
    [#4525](nodejs/node#4525)
* HTTP
  * 'clientError' can now be used to return custom errors from an
    HTTP server [#4557](nodejs/node#4557).
* Modules
  * Current directory is now prioritized for local lookups
    [#5689](nodejs/node#5689)
  * Symbolic links are preserved when requiring modules
    [#5950](nodejs/node#5950)
* Net
  * DNS hints no longer implicitly set
    [#6021](nodejs/node#6021).
  * Improved error handling and type checking
    [#5981](nodejs/node#5981),
    [#5733](nodejs/node#5733),
    [#2904](nodejs/node#2904)
* OS X
  * MACOSX_DEPLOYMENT_TARGET has been bumped up to 10.7
    [#6402](nodejs/node#6402).
* Path
  * Improved type checking [#5348](nodejs/node#5348).
* Process
  * Introduce process warnings API
    [#4782](nodejs/node#4782).
  * Throw exception when non-function passed to nextTick
    [#3860](nodejs/node#3860).
* Readline
  * Emit key info unconditionally
    [#6024](nodejs/node#6024)
* REPL
  * Assignment to `_` will emit a warning.
    [#5535](nodejs/node#5535)
* Timers
  * Fail early when callback is not a function
    [#4362](nodejs/node#4362)
* TLS
  * Rename 'clientError' to 'tlsClientError'
    [#4557](nodejs/node#4557)
  * SHA1 used for sessionIdContext
    [#3866](nodejs/node#3866)
* TTY
  * Previously deprecated setRawMode wrapper is removed
    [#2528](nodejs/node#2528).
* Util
  * Changes to Error object formatting
    [#4582](nodejs/node#4582).
* Windows
  * Windows XP and Vista are no longer supported
    [#5167](nodejs/node#5167),
    [#5167](nodejs/node#5167).
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: nodejs/node#5533

PR-URL: nodejs/node#6337
Reviewed-By: Claudio Rodriguez <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Roman Reiss <[email protected]>
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: nodejs/node#6404
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Use new API of Buffer to developers in most documents.

PR-URL: nodejs/node#6367
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
Prevent misleading error messages when trailers are invalid.

PR-URL: nodejs/node#6308
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Brian White <[email protected]>
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: nodejs/node#5566
PR-URL: nodejs/node#6371
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Robert Lindstaedt <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
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: nodejs/node#6395
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
This also updates the tests to expect that a closed handle has no
reference count.

PR-URL: nodejs/node#6395
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Verify that a second call to handle.close() is a no-op.

PR-URL: nodejs/node#6395
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
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: nodejs/node#6393
Reviewed-By: Anna Henningsen <[email protected]>
@kunalspathak
Copy link
Member

LGTM.

Jianchun Xu added 2 commits May 2, 2016 10:57
Sync to nodejs/master (2016-04-27)

PR-URL: nodejs#66
Reviewed-By: Kunal Pathak <[email protected]>
There was `module.js` change. Update message baselines.

PR-URL: nodejs#66
Reviewed-By: Kunal Pathak <[email protected]>
@jianchun jianchun merged commit c7129ab into nodejs:chakracore-master May 2, 2016
@jianchun jianchun deleted the sync branch May 2, 2016 18:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.