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

18590 Commits

Author SHA1 Message Date
Michael Albert
aa24777c44
test: increase coverage for http2.connect
Added checks for connecting using https and an unsupported protocol.

PR-URL: https://github.com/nodejs/node/pull/14832
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-21 01:41:41 +02:00
Anand Suresh
39dd230366
doc: minor fixes to http/2 docs
PR-URL: https://github.com/nodejs/node/pull/14877
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-08-21 01:37:51 +02:00
Rich Trott
c473d80a9c test: make timers-blocking-callback more reliable
test-timers-blocking-callback may fail erroneously on
resource-constrained machines due to the timing nature of the test.

There is likely no way around the timing issue. This change tries to
decrease the probability of the test failing erroneously by having it
retry a small number of times on failure.

Tested on 0.10.38 (which has a bug that this test was written for) and
(modifying the test slightly to remove ES6 stuff) the test still seems
to fail 100% of the time there, which is what we want/expect.

PR-URL: https://github.com/nodejs/node/pull/14831
Fixes: https://github.com/nodejs/node/issues/14792
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-20 15:41:18 -07:00
Aleh Zasypkin
e96c11c384
doc,fs: rename defaultEncoding option to encoding
The documentation for `fs.createWriteStream()` references a
`defaultEncoding` as possible options property, but in reality
`encoding` property is expected and properly handled. This fix updates
the documentation to rename the `defaultEncoding` property to
`encoding`.

PR-URL: https://github.com/nodejs/node/pull/14867
Fixes: https://github.com/nodejs/node/issues/14611
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-20 18:03:51 -04:00
Beth Griggs
b9d63ab1b7 test: remove erroneous assert message from test
Removes the incorrect 'exit successfully' message from test when the
exit code is 0.

PR-URL: https://github.com/nodejs/node/pull/14918
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-08-20 20:00:40 +02:00
George Sapkin
4cff2cc20f doc: remove redundant only from doc/api/stream.md
PR-URL: https://github.com/nodejs/node/pull/14858
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-20 11:05:13 +02:00
Tobias Nießen
467385a49b test: use invalid host according to RFC2606
PR-URL: https://github.com/nodejs/node/pull/14863
Refs: https://github.com/nodejs/node/pull/14781
Refs: https://tools.ietf.org/html/rfc2606#section-2
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2017-08-19 00:08:37 +02:00
James M Snell
fd8cf79056 src: miscellaneous cleanups for node_config
Includes a fix for setting the `icuDataDir` as a UTF8 string
rather than one byte. Previously, if the dir contained any
non-ascii characters they would be mangled. This won't cover
cases that involve paths with other character encodings
(thank you Linux).. but it will cover the most likely.

Other miscellaneous cleanups are included

PR-URL: https://github.com/nodejs/node/pull/14868
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-08-18 15:04:26 -07:00
James M Snell
35f6e59dfc src: minor cleanup for node_revert
Make the revert related functions inline to eliminate the need
for node_revert.cc, prefix the constants and the def, other misc
cleanup

PR-URL: https://github.com/nodejs/node/pull/14864
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-08-18 15:02:12 -07:00
Rich Trott
b5bad25110 tools: remove stray package-lock.json file
Before the ESLint updates were automated, a stray package-lock.json file
was accidentally introduced in the tools directory. This change removes
it.

PR-URL: https://github.com/nodejs/node/pull/14873
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-18 14:32:28 -07:00
Jon Moss
0914880229 doc: add missing word
PR-URL: https://github.com/nodejs/node/pull/14924
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-18 14:25:22 -07:00
陈刚
4d842e3d66 doc: fix http api document
PR-URL: https://github.com/nodejs/node/pull/14625
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2017-08-18 17:12:04 +03:00
Myles Borins
fb732561a8
tools: fix update-eslint.sh
The script currently assumes that there is a package.json in
`eslint-tmp`. If there isn't the logic of the script fails.
This adds a call to `npm init --yes` ensuring there is a package.json
and that the script can do it's thing.

PR-URL: https://github.com/nodejs/node/pull/14850
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2017-08-18 04:07:52 -07:00
Michaël Zasso
2062a69879 build: stop support building addons with VS 2013
PR-URL: https://github.com/nodejs/node/pull/14764
Refs: https://github.com/nodejs/node/pull/14730#issuecomment-321609328
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-08-18 10:46:05 +02:00
Rich Trott
d15a5c0fe1 doc: explain what to do if git push is rejected
In COLLABORATOR_GUIDE.md, explain what to do if `git push upstream
master` is rejected.

PR-URL: https://github.com/nodejs/node/pull/14848
Fixes: https://github.com/nodejs/node/issues/12628
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-08-17 21:41:28 -07:00
Rich Trott
0c5ea126dc test: add test for cluster benchmarks
Add minimal test to make sure cluster benchmark code runs.

PR-URL: https://github.com/nodejs/node/pull/14812
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
2017-08-17 21:16:26 -07:00
Eugene Ostroukhov
7027191288 test: Mark test-stop-profile-after-done flaky
It is flaky on Windows and AIX. Some more time is needed to fix it.

PR-URL: https://github.com/nodejs/node/pull/14874#pullrequestreview-56752371
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-08-17 14:40:22 -07:00
Anna Henningsen
4766fcb96d
http2: minor refactor of passing headers to JS
- Make `ExternalString::New` return a `MaybeLocal`. Failing is
  left up to the caller.
- Allow creating internalized strings for short header names
  to reduce memory consumption and increase performance.
- Use persistent storage for statically allocated header names.

PR-URL: https://github.com/nodejs/node/pull/14808
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-08-17 22:55:01 +02:00
Anna Henningsen
0d9afa0288
deps: cherry-pick eb306f463e from nghttp2 upstream
Original commit message:

  lib: add nghttp2_rcbuf_is_static()

  Add a `nghttp2_rcbuf_is_static()` method to tell whether a rcbuf
  is statically allocated.

  This can be useful for language bindings that wish to avoid
  creating duplicate strings for these buffers; concretely, I am
  planning to use this in the Node HTTP/2 module that is being
  introduced.

Ref: eb306f463e
PR-URL: https://github.com/nodejs/node/pull/14808
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-08-17 22:54:28 +02:00
Anna Henningsen
9ecc440642
buffer: fix MAX_LENGTH constant export
This was a typo and accidentally returned the wrong value.

Fixes: https://github.com/nodejs/node/issues/14819
Ref: https://github.com/nodejs/node/pull/13467
PR-URL: https://github.com/nodejs/node/pull/14821
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-08-17 20:32:26 +02:00
Ruben Bridgewater
f853baf544
test: check util.inspect circular Set and Map refs
Ref: https://github.com/nodejs/node/pull/14775
PR-URL: https://github.com/nodejs/node/pull/14790
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-08-17 20:27:01 +02:00
Anna Henningsen
859a228594
util: use proper circular reference checking
Circular references are conceptually nothing that should be checked
for objects (or Sets or Maps) only, but applies to recursive structures
in general, so move the `seen` checks into a position where it is part
of the recursion itself.

Fixes: https://github.com/nodejs/node/issues/14758
PR-URL: https://github.com/nodejs/node/pull/14790
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben.bridgewater@fintura.de>
2017-08-17 20:27:00 +02:00
Anna Henningsen
491cc76871
src: use unordered_set instead of custom rb tree
Use a standard hash-based container instead of the custom included
red/black tree implementation. There is likely no noticeable
performance difference, and if there is one, it is very likely
to be an improvement.

PR-URL: https://github.com/nodejs/node/pull/14826
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-17 20:26:59 +02:00
Matt Loring
9e08695f85
src: Node implementation of v8::Platform
Node.js currently uses the V8 implementation of the DefaultPlatform
which schedules VM tasks on a V8 managed thread pool. Since the Node.js
event loop is not aware of these tasks, the Node.js process may exit
while there are outstanding VM tasks. This will become problematic once
asynchronous wasm compilation lands in V8.

This PR introduces a Node.js specific implementation of the v8::Platform
on top of libuv so that the event loop is aware of outstanding VM tasks.

PR-URL: https://github.com/nodejs/node/pull/14001
Fixes: https://github.com/nodejs/node/issues/3665
Fixes: https://github.com/nodejs/node/issues/8496
Fixes: https://github.com/nodejs/node/issues/12980
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-17 20:26:55 +02:00
Matt Loring
5e5a52fc93
tracing: Update to use new Platform tracing apis
V8 modified the platform API to accept a tracing controller at platform
creation time that is required to be present for the lifetime of the
platform if tracing will every be enabled. This will simplify the
implementation of a v8::Platform subclass for node.

PR-URL: https://github.com/nodejs/node/pull/14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-17 20:26:49 +02:00
Matt Loring
fabe1b4e19
deps: backport f9c4b7a from upstream V8
Original commit message:

  [heap] Move UnmapFreeMemoryTask to CancelableTask
  This mitigates the problem of blocking on the main thread when the
  platform is unable to execute background tasks in a timely manner.

  Bug: v8:6671
  Change-Id: I741d4b7594e8d62721dad32cbfb19551ffacd0c3
  Reviewed-on: https://chromium-review.googlesource.com/599528
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47126}

PR-URL: https://github.com/nodejs/node/pull/14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-17 20:26:39 +02:00
Matt Loring
64162a1041
deps: backport bca8409 from upstream V8
Original commit message:

  Make CancelableTask ids unique
  They were only limited to 32 bit when using the internal Hashmap. Since
  this has changed alreay some time ago, we can switch to 64 bit ids and
  check that we never overflow.

  Bug:
  Change-Id: Ia6c6d02d6b5e555c6941185a79427dc4aa2a1d62
  Reviewed-on: https://chromium-review.googlesource.com/598229
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47085}

PR-URL: https://github.com/nodejs/node/pull/14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-17 20:26:28 +02:00
Matt Loring
354a17b0c0
deps: backport 6e9e2e5 from upstream V8
Original commit message:

  [heap] Move SweeperTask to CancelableTask
  This mitigates the problem of blocking on the main thread when the
  platform is unable to execute background tasks in a timely manner.

  Bug: v8:6655
  Change-Id: Icdaae744ee73146b86b9a28c8035138746721971
  Reviewed-on: https://chromium-review.googlesource.com/595467
  Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
  Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#47036}

PR-URL: https://github.com/nodejs/node/pull/14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-17 20:26:17 +02:00
Matt Loring
4fbedbbfc3
deps: backport 3d8e87a from upstream V8
Original commit message:

  Switch tracing to use v8::TracingController

  BUG=v8:6511
  R=fmeawad@chromium.org

  Cq-Include-Trybots:
  master.tryserver.chromium.linux:linux_chromium_rel_ng
  Change-Id: I4961e4b61a9ddc98385ed97c3ffcbcaef2d9cba7
  Reviewed-on: https://chromium-review.googlesource.com/543144
  Commit-Queue: Jochen Eisinger <jochen@chromium.org>
  Reviewed-by: Fadi Meawad <fmeawad@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#46307}

PR-URL: https://github.com/nodejs/node/pull/14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-17 20:26:09 +02:00
Matt Loring
832a87f906
deps: backport 5152d97 from upstream V8
Original commit message:

  Add API to create a platform with a tracing controller
  BUG=v8:6511

  Cq-Include-Trybots:
  master.tryserver.chromium.linux:linux_chromium_rel_ng
  Change-Id: Ie6b62df693d3b847837c071e1f985b7ce3b420c8
  Reviewed-on: https://chromium-review.googlesource.com/548499
  Reviewed-by: Fadi Meawad <fmeawad@chromium.org>
  Commit-Queue: Jochen Eisinger <jochen@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#46227}

PR-URL: https://github.com/nodejs/node/pull/14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-17 20:25:53 +02:00
Matt Loring
4f21834962
deps: backport c4852ea from upstream V8
Original commit message:

  Pull tracing related methods out of Platform
  This will allow for embedders to easily implement their own Platform
  without duplicating the tracing controller code.

  BUG=v8:6511
  R=fmeawad@chromium.org

  Cq-Include-Trybots:
  master.tryserver.chromium.linux:linux_chromium_rel_ng
  Change-Id: I7c64933d12b2cf53f0636fbc87f6ad5d22019f5c
  Reviewed-on: https://chromium-review.googlesource.com/543015
  Commit-Queue: Jochen Eisinger <jochen@chromium.org>
  Reviewed-by: Fadi Meawad <fmeawad@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#46118}

PR-URL: https://github.com/nodejs/node/pull/14001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-17 20:25:14 +02:00
Sebastian Murphy
c49dcb319b
benchmark: convert var to es6 const
Converted var variable to es6 const to maintain
consistency with other benchmark files. Also clean up
the types array to make the files more succinct.

PR-URL: https://github.com/nodejs/node/pull/12886
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-17 12:19:13 -04:00
Ben Noordhuis
aa011a111d Revert "build: don't add libraries when --enable-static"
Reverted for breaking the Windows build with the following error:

    LINK : fatal error LNK1181: cannot open input file
    'c:\workspace\node-compile-windows\label\win-vs2015\
    Release\obj\node\gen\node_javascript.o'

This reverts commit be63c26e8c.

PR-URL: https://github.com/nodejs/node/pull/14893
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2017-08-17 16:11:29 +02:00
Jaideep Bajwa
8096791d8d deps: cherry-pick fa4ec9f from V8 upstream
Original commit message:

    [date] Refactor PosixTimezoneCache for different OS

    Follow up on https://codereview.chromium.org/2740353002. Created
    PosixDefaultTimezoneCache which is a subclass of PosixTimezoneCache
    containing definition of LocalTimezone and LocalTimeOffset which is
    separate for different OS.

    R=littledan@chromium.org, ulan@chromium.org

    BUG=v8:6578
    LOG=N

    Change-Id: I58342893aeefe79ac50e1df041d614fc473f15bf
    Reviewed-on: https://chromium-review.googlesource.com/568686
    Reviewed-by: Daniel Ehrenberg <littledan@chromium.org>
    Commit-Queue: Jaideep Bajwa <bjaideep@ca.ibm.com>
    Cr-Commit-Position: refs/heads/master@{#46604}

PR-URL: https://github.com/nodejs/node/pull/14608
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-17 15:42:49 +02:00
Miroslav Bajtoš
a0895ed6c4
inspector: enable async stack traces
Implement a special async_hooks listener that forwards information
about async tasks to V8Inspector asyncTask* API, thus enabling
DevTools feature "async stack traces".

The feature is enabled only on 64bit platforms due to a technical
limitation of V8 Inspector: inspector uses a pointer as a task id,
while async_hooks use 64bit numbers as ids.

To avoid performance penalty of async_hooks when not debugging,
the new listener is enabled only when the process enters a debug mode:

 - When the process is started with `--inspect` or `--inspect-brk`,
   the listener is enabled immediately and async stack traces
   lead all the way to the first tick of the event loop.

 - When the debug mode is enabled via SIGUSR1 or `_debugProcess()`,
   the listener is enabled together with the debugger. As a result,
   only async operations started after the signal was received
   will be correctly observed and reported to V8 Inspector. For example,
   a `setInterval()` called in the first tick of the event will not be
   shown in the async stack trace when the callback is invoked. This
   behaviour is consistent with Chrome DevTools.

Last but not least, this commit fixes handling of InspectorAgent's
internal property `enabled_` to ensure it's set back to `false`
after the debugger is deactivated (typically via `process._debugEnd()`).

Fixes: https://github.com/nodejs/node/issues/11370
PR-URL: https://github.com/nodejs/node/pull/13870
Reviewed-by: Timothy Gu <timothygu99@gmail.com>
Reviewed-by: Anna Henningsen <anna@addaleax.net>
2017-08-17 20:52:39 +08:00
Timothy Gu
b616e87947
test: fix inspector helper port sniffing
PR-URL: https://github.com/nodejs/node/pull/13870
Reviewed-By: Miroslav Bajtoš <mbajtoss@gmail.com>
2017-08-17 20:51:45 +08:00
Daniel Bevenius
be63c26e8c build: don't add libraries when --enable-static
Currently when building with --enabled-static the cctest target will
include libraries to be linked regardless. This commit adds a condition
to only add the libraries when dynamically linking.

PR-URL: https://github.com/nodejs/node/pull/14837
Fixes: https://github.com/nodejs/node/issues/13500
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-17 07:15:17 +02:00
Eugene Ostroukhov
cd9f81d5bf deps: fix inspector v8 test
This fixes the inspector tests failing after the cherry-pick.

V8 commit: f19b889be8
PR-URL: https://github.com/nodejs/node/pull/14827
Fixes: https://github.com/nodejs/node/issues/14824
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-08-16 16:20:04 -07:00
Ruben Bridgewater
e9c0263696
doc: add BridgeAR to collaborators
PR-URL: https://github.com/nodejs/node/pull/14862
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-16 13:48:56 -03:00
hsmtkk
472a8a7f8d
doc: fix typo in cli.md
PR-URL: https://github.com/nodejs/node/pull/14855
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Roman Reiss <me@silverwind.io>
2017-08-16 18:14:13 +02:00
Beth Griggs
c879c9a5c6 test: preserve env in test cases
Allows env vars to be passed through to child processes. This is needed
for things like NODE_TEST_DIR or LD_LIBRARY_PATH if testing the shared
library.

PR-URL: https://github.com/nodejs/node/pull/14822
Refs: https://github.com/nodejs/node/pull/13390
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-16 17:16:27 +02:00
Ruslan Bekenev
2710616d53 build: remove duplicated code
Makefile contains copy-pasted code in some targets and this commit
aims to remove it.

PR-URL: https://github.com/nodejs/node/pull/13482
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Kunal Pathak <kunal.pathak@microsoft.com>
2017-08-16 17:04:23 +02:00
James M Snell
949aec5c32 http2: handful of http/2 src cleanups
* inline more stuff. remove a node_http2_core.cc
* clean up debug messages
* simplify options code, and cleanup

PR-URL: https://github.com/nodejs/node/pull/14825
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-08-16 07:27:32 -07:00
phisixersai
2e91d8d483 tools: delete an unused argument
PR-URL: https://github.com/nodejs/node/pull/14251
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-16 12:37:15 +02:00
fengmk2
620ba41694 http: don't double-fire the req error event
req.socket._hadError should be set before emitting the error event.

PR-URL: https://github.com/nodejs/node/pull/14659
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-16 12:27:43 +02:00
Kyle Farnung
e96b94970a doc: added napi_get_value_string_latin1
* Reordered string functions alphabetically
* Fixed a typo in napi_get_value_string_utf8

PR-URL: https://github.com/nodejs/node/pull/14678
Fixes: https://github.com/nodejs/node/issues/14397
Refs: https://github.com/nodejs/node/issues/14256
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-08-16 12:16:45 +02:00
Runite618
d4374ad651 test: refactor async-hooks/test-httparser tests
CRLF variable was defined but only used on line 22 so the variable
was deleted and placed inside line 22 as a string literal. This
was in file test-httpparser.request.js

On line 46 there's a function declared that takes 3 arguments but
none of them are ever used so removed. This is in file
test-httpparser.response.js

PR-URL: https://github.com/nodejs/node/pull/14818
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-16 12:06:47 +02:00
Pini Houri
3f5d944ace http2: Expose Http2ServerRequest/Response
In order for express (and possibly other libraries) to get and use
the Http2ServerRequest/Response - expose them in the http2 exports.
Same as is done in http module.

PR-URL: https://github.com/nodejs/node/pull/14690
Ref: https://github.com/expressjs/express/issues/3390
Fixes: https://github.com/nodejs/node/issues/14672
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-08-16 12:58:59 +03:00
Saad Quadri
eab2bea46f doc: fix word wrapping for api stability boxes
PR-URL: https://github.com/nodejs/node/pull/14809
Fixes: https://github.com/nodejs/nodejs.org/issues/1337
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-16 11:49:55 +02:00
icarter09
0309619aa7 test: use reserved invalid hostname for tests
PR-URL: https://github.com/nodejs/node/pull/14781
Refs: https://tools.ietf.org/html/rfc2606#section-2
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-16 11:44:02 +02:00