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

23372 Commits

Author SHA1 Message Date
MaleDong
e7b4ba9003 doc: make createPushResponse() more detailled
We don't know what will return when successful or failure for
the callback of the function. So this commit makes it more detailled.

PR-URL: https://github.com/nodejs/node/pull/22366
Refs: https://github.com/nodejs/node/issues/22322
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-08-23 09:07:28 +02:00
James M Snell
264c99f6c6
src: move more to node_process.cc from node.cc
PR-URL: https://github.com/nodejs/node/pull/22422
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-08-22 17:58:28 -07:00
Refael Ackermann
d32051147c build: use npm ci
* remove obsolete `node_modules/js-yaml/package.json` target
* remove `@touch` since `npm ci` is always destructive

PR-URL: https://github.com/nodejs/node/pull/22399
Refs: https://github.com/nodejs/node/pull/21802
Refs: https://github.com/nodejs/node/pull/21490
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Sam Ruby <rubys@intertwingly.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2018-08-22 20:19:54 -04:00
Daniel Bevenius
9d9f691d26 Revert "build: extract common code from NODE_EXE/_G_EXE"
This reverts commit 4e2fa8b0dc.

Refs: https://github.com/nodejs/node/issues/22457

PR-URL: https://github.com/nodejs/node/pull/22458
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-08-22 19:23:33 -04:00
Ruben Bridgewater
68b07ded9c
repl: tab auto complete big arrays
Due to a new API it's possible to skip the indices. That allows to
use auto completion with big (typed) arrays.

PR-URL: https://github.com/nodejs/node/pull/22408
Fixes: https://github.com/nodejs/node/issues/21446
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-08-23 00:10:52 +02:00
Ruben Bridgewater
c35ce5635c
test: harden sequential/test-performance
1) This adds a better error logging so we are able to address further
   failures easier.
2) It adds a extra epsilon so the test runs into less issues in case
   the machine is under heavy load.
3) The epsilon in increased if the CPU is under heavy load.
4) The total startup epsilon was reduced due to recent startup time
   improvements.

PR-URL: https://github.com/nodejs/node/pull/22404
Fixes: https://github.com/nodejs/node/issues/19197
Refs: https://github.com/nodejs/reliability/issues/14
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-08-23 00:08:09 +02:00
Anna Henningsen
29a71bae40
src: refactor options parsing
This is a major refactor of our Node’s parser. See `node_options.cc`
for how it is used, and  `node_options-inl.h` for the bulk
of its implementation.

Unfortunately, the implementation has come to have some
complexity, in order to meet the following goals:

- Make it easy to *use* for defining or changing options.
- Keep it (mostly) backwards-compatible.
  - No tests were harmed as part of this commit.
- Be as consistent as possible.
  - In particular, options can now generally accept arguments
    through both `--foo=bar` notation and `--foo bar` notation.
    We were previously very inconsistent on this point.
- Separate into different levels of scope, namely
  per-process (global), per-Isolate and per-Environment
  (+ debug options).
- Allow programmatic accessibility in the future.
  - This includes a possible expansion for `--help` output.

This commit also leaves a number of `TODO` comments, mostly for
improving consistency even more (possibly with having to modify
tests), improving embedder support, as well as removing pieces of
exposed configuration variables that should never have become
part of the public API but unfortunately are at this point.

PR-URL: https://github.com/nodejs/node/pull/22392
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
2018-08-22 23:37:19 +02:00
cjihrig
92880f31da
os: add os.{get,set}Priority()
PR-URL: https://github.com/nodejs/node/pull/22407
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-08-22 17:27:16 -04:00
Matteo Collina
91eec00ca2 tty: make _read throw ERR_TTY_WRITABLE_NOT_READABLE
This change avoid an 'read ENOTCONN' error introduced by libuv 1.20.0
when trying to read from a TTY WriteStream. Instead, we are throwing
a more actionable ERR_TTY_WRITABLE_NOT_READABLE.

Fixes: https://github.com/nodejs/node/issues/21203

PR-URL: https://github.com/nodejs/node/pull/21654
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-08-22 16:41:54 +02:00
Bryan English
6acb55041b test: remove redundant cli tests
test/parallel/test-cli-eval.js covers them, and many more things.

PR-URL: https://github.com/nodejs/node/pull/22355
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: George Adams <george.adams@uk.ibm.com>
2018-08-22 01:18:53 -07:00
Anto Aravinth
413a7e1dea http: adding doc and debug for calling empty string on write function
PR-URL: https://github.com/nodejs/node/pull/22118
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-08-22 09:48:09 +02:00
Matteo Collina
98cf84f2c9 stream: restore flow if there are 'data' handlers after once('readable')
Fixes: https://github.com/nodejs/node/issues/21398
See: https://github.com/nodejs/node/pull/21696

PR-URL: https://github.com/nodejs/node/pull/22209
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Mathias Buus <mathiasbuus@gmail.com>
2018-08-21 22:36:13 -07:00
James M Snell
588fb05e78
perf_hooks: move strings to env
Move repeatedly created strings to env

PR-URL: https://github.com/nodejs/node/pull/22401
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-08-21 22:29:08 -07:00
Daniel Bevenius
4e2fa8b0dc build: extract common code from NODE_EXE/_G_EXE
This commit extracts common parts of the NODE_EXE, and NODE_G_EXE
recipes into a canned reciepe to reduce some code duplication.

PR-URL: https://github.com/nodejs/node/pull/22310
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-08-22 06:32:47 +02:00
Ruben Bridgewater
36468ca928
lib: require a callback for end-of-stream
Make the callback mandatory as mostly done in all other Node.js
callback APIs so users explicitly have to decide what to do in error
cases.

This also documents the options for `Stream.finished()`.

When originally implemented it was missed that Stream.finished() has
an optional options object.

PR-URL: https://github.com/nodejs/node/pull/21058
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Mathias Buus <mathiasbuus@gmail.com>
2018-08-22 01:00:27 +02:00
Gabriel Schulhof
9dae0ae22b doc: update wrapping-related documentation
Update the N-API documentation to reflect that wrapping no longer
affects the object's prototype chain.

PR-URL: https://github.com/nodejs/node/pull/22363
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-08-21 13:56:56 -04:00
Michaël Zasso
0f85e20d3e
deps: patch V8 to 6.8.275.30
Refs: https://github.com/v8/v8/compare/6.8.275.24...6.8.275.30

PR-URL: https://github.com/nodejs/node/pull/22125
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
2018-08-21 13:22:04 +02:00
MaleDong
6e9e150b6a util: Fix number format for pad
`pad` is now using `toString(10)`, actually we don't need to do this. As for https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString, `toString(N)` is a radix converter, which isn't proper here for time conversion.

PR-URL: https://github.com/nodejs/node/pull/21906
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sam Ruby <rubys@intertwingly.net>
2018-08-21 00:28:47 -04:00
Rich Trott
36696cfe84 test: improve assert message in http timeout test
PR-URL: https://github.com/nodejs/node/pull/22403
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-08-20 18:59:12 -07:00
Rich Trott
4b71b01339 test: move http timeout test to parallel
test-http-client-timeout-option-with-agent no longer checks that the
timeout happens within a certain tolerance so it can be moved to the
parallel test suite.

PR-URL: https://github.com/nodejs/node/pull/22403
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-08-20 18:59:08 -07:00
Rich Trott
fd76a3d482 test: fix flaky http timeout test
There is no guarantee that a timeout won't be delayed considerably due
to unrelated activity on the host. Instead of checking that the timeout
happens within a certain tolerance, simply check that it did not happen
too soon.

Fixes: https://github.com/nodejs/node/issues/22041

PR-URL: https://github.com/nodejs/node/pull/22403
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-08-20 18:59:00 -07:00
Alexey Kozyatinskiy
b1e26128f3 src: implement v8::Platform::CallDelayedOnWorkerThread
This method is crucial for Runtime.evaluate protocol command with
timeout flag. At least Chrome DevTools frontend uses this method for
every execution in console.

PR-URL: https://github.com/nodejs/node/pull/22383
Fixes: https://github.com/nodejs/node/issues/22157
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-08-20 18:10:00 -07:00
Dzmitry_Prudnikau
f1d3f97c3b
test: remove third argument from assert.strictEqual()
`test/parallel/test-util-inspect.js` has a call to
`assert.strictEqual()` that receives three arguments.
The third argument is a string literal. Unfortunately,
calling assert.strictEqual() this way means that if
there is an AssertionError, the value of the variables
pos and npos are not reported.
This PR removes this argument.

PR-URL: https://github.com/nodejs/node/pull/22371
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: George Adams <george.adams@uk.ibm.com>
2018-08-20 19:53:54 +01:00
Daniel Bevenius
28675b66d2 build: move available-node variable to top
Currently node_use_openssl uses the available-node variable before it is
defined causing the conditions that use it before that point to
evaluate incorrectly. As an example running the target
test/addons/.docbuildstamp will currently be skipped:

$ make test/addons/.docbuildstamp
Skipping .docbuildstamp (no crypto)

With this commit the target will only be skipped if configured --without-ssl.

PR-URL: https://github.com/nodejs/node/pull/22356
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-08-20 18:51:47 +02:00
cjihrig
8d05a1590a
test: cover error case in os getCheckedFunction()
getCheckedFunction() is used internally by the os module to
handle errors from the binding layer in several methods. This
commit adds a test for the case where the binding layer returns
an error.

PR-URL: https://github.com/nodejs/node/pull/22394
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2018-08-20 11:33:02 -04:00
cjihrig
5e420f95b1
os: destructure ERR_SYSTEM_ERROR properly
PR-URL: https://github.com/nodejs/node/pull/22394
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2018-08-20 11:33:02 -04:00
Ruben Bridgewater
9bcb744ee5
os: improve networkInterfaces performance
This algorithm uses less data transformations and is therefore
significantly faster than the one before.

PR-URL: https://github.com/nodejs/node/pull/22359
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-08-20 16:10:20 +02:00
Daniel Bevenius
104492bd83
build: touch tools/doc/node_modules after run
Currently, tools/doc/node_modules is not touched after running npm
install resulting in npm install being run every time. I missed this
while testing commit 88bff82624 ("build:
make tools/doc/node_modules non-phony").

PR-URL: https://github.com/nodejs/node/pull/22350
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-08-20 16:08:12 +02:00
cjihrig
4e7d82945d
deps: upgrade to libuv 1.23.0
Notable changes:
- Restores compatibility with the old IPC protocol.
- Adds uv_open_osfhandle().
- Adds uv_os_{get,set}priority().

PR-URL: https://github.com/nodejs/node/pull/22365
Fixes: https://github.com/nodejs/node/issues/21671
Fixes: https://github.com/nodejs/node/issues/15433
Refs: https://github.com/nodejs/node/pull/21675
Refs: https://github.com/nodejs/node-addon-api/issues/304
Refs: https://github.com/nodejs/abi-stable-node/issues/318
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-08-20 08:39:30 -04:00
Daniel Bevenius
95b0e2c133 build: add test-doc to test target
This commit adds the test-doc target to the test recipe so that docs are
built and linters run. This used to happen but was removed at some
point.

PR-URL: https://github.com/nodejs/node/pull/22294
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-08-20 13:20:24 +02:00
Caleb Sander
439b75b9c0
assert, util: *DeepEqual() handles ArrayBuffers
Previously, all ArrayBuffers were considered equal in assert.deepEqual()
and assert.deepStrictEqual().
Now, ArrayBuffers and SharedArrayBuffers must have the same byte lengths
and contents to be considered equal.
In loose mode, an ArrayBuffer is considered equal to a SharedArrayBuffer
if they have the same contents, whereas in strict mode, the buffers must
be both ArrayBuffers or both SharedArrayBuffers.

PR-URL: https://github.com/nodejs/node/pull/22266
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-08-20 12:03:08 +02:00
Daniel Bevenius
6bc43aeea7 build: use echo command instead of shell comments
Currently, there are a few recipes where comments are indented
and being passed to the shell.

This commit updates these comments to use the echo command instead,
which is the more common approach used in other recipes in the
makefile.

PR-URL: https://github.com/nodejs/node/pull/22293
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
2018-08-20 11:05:45 +02:00
Ruben Bridgewater
79642ae071
test: harden test-gc-http-client
This reduces the total number of requests from 500 to 300 and triggers
more requests in parallel. It also moves some function creation out
and waits with the first request until the server is listening.

PR-URL: https://github.com/nodejs/node/pull/22373
Fixes: https://github.com/nodejs/node/issues/22336
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-08-20 09:20:36 +08:00
Ruben Bridgewater
3479b1ca82
util,assert: improve performance
This significantly improves regular and typed array performance by
not checking the indices keys anymore. This can be done with a V8
API that allows to only retrieve the non indices property keys.

PR-URL: https://github.com/nodejs/node/pull/22197
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-08-20 02:11:46 +02:00
James M Snell
0bdb95f4cf
src: move process.binding('signal_wrap') to internalBinding
PR-URL: https://github.com/nodejs/node/pull/22290
Refs: https://github.com/nodejs/node/issues/22160
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-08-19 14:18:29 -07:00
James M Snell
884b23daf7
stream: move process.binding('stream_wrap') to internalBinding
PR-URL: https://github.com/nodejs/node/pull/22345
Refs: https://github.com/nodejs/node/issues/22160
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-08-19 12:46:10 -07:00
Vse Mozhet Byt
7108893ec8 doc: clarify fs.write[Sync]() descriptions
1. All default values for optional `encoding` parameters
   were documented except for the one in `fs.write(fd, string...)`
   method. This PR makes up this deficiency.

2. We have two variants of `fs.write()` / `fs.writeSync()` methods:
   for buffers and strings. Currently, the sync methods have only one
   common reference to the full description of async methods.
   However, the link may seem to belong to the last sync variant only
   (for strings) and, as it refers to the first async variant
   (for buffers), this may be confusing. This PR makes two different
   sync variants refer to two different async variants.

3. In passing, both returned values of sync methods were also made
   more concise and unambiguous.

PR-URL: https://github.com/nodejs/node/pull/22402
Refs: a04f2f7df6/lib/fs.js (L549)
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-08-19 21:52:14 +03:00
Vse Mozhet Byt
14e6274bed doc: unify optional arguments format in headings
Make space and comma distribution in some headings
consistent with the majority of headings.

PR-URL: https://github.com/nodejs/node/pull/22397
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-08-19 21:45:39 +03:00
Ruben Bridgewater
bd090f9220
util: mark special entries as such
This adds the color code to special entries if colors are active.

PR-URL: https://github.com/nodejs/node/pull/22287
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-08-19 19:00:31 +02:00
Ruben Bridgewater
a04f2f7df6
util: escape symbol and non-enumerable keys
These keys require escaping as they might also contain line breaks
and other special characters.

PR-URL: https://github.com/nodejs/node/pull/22300
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-08-19 14:22:17 +02:00
Rich Trott
c535bde5da tools: simplify ESLint invocation in Makefile
Makefile currently enforces .eslintrc.js linting on the command line but
it is already enforced in the .estlintignore file.

This also simplifies an arguably-related comment in .estlinrc.js.

PR-URL: https://github.com/nodejs/node/pull/22348
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-08-18 18:48:55 -07:00
James M Snell
892932f9bd
v8: move process.binding('v8') to internalBinding
PR-URL: https://github.com/nodejs/node/pull/22288
Refs: https://github.com/nodejs/node/issues/22160
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-08-18 16:27:11 -07:00
James M Snell
1744205ff5
http: move process.binding('http_parser') to internalBinding
Refs: https://github.com/nodejs/node/issues/22160

PR-URL: https://github.com/nodejs/node/pull/22329
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-08-18 13:01:21 -07:00
James M Snell
4fa5448e5d
http2: move process.binding('http2') to internalBinding
Refs: https://github.com/nodejs/node/issues/22160

PR-URL: https://github.com/nodejs/node/pull/22328
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-08-18 12:39:59 -07:00
Timothy Gu
c7788fba28 src: encode 0x27 (') for special URLs
Refs: 6ef17ebe12
PR-URL: https://github.com/nodejs/node/pull/22022
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-08-18 15:18:05 -04:00
Joyee Cheung
2d72a9543c
src: implement the new EmbedderGraph::AddEdge()
The signature of EmbedderGraph::AddEdge() has been changed so
the current implementation of JSGraph no longer compiles.
This patch updates the implementation accordingly.

PR-URL: https://github.com/nodejs/node/pull/22106
Refs: 6ee834532d
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-08-19 00:52:42 +08:00
Joyee Cheung
54c87f37f4
deps: cherry-pick 6ee8345 from upstream V8
Original commit message:

    [heap-profiler] Allow embedder to specify edge names

    This patch adds a variant of EmbedderGraph::AddEdge() which
    allows the embedder to specify the name of an edge. The edges
    added without name are element edges with auto-incremented indexes
    while the edges added with names will be internal edges with
    the specified names for more meaningful output in the heap
    snapshot.

    Refs: https://github.com/nodejs/node/pull/21741
    Bug: v8:7938
    Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
    Change-Id: I8feefa2cf6911743e24b3b2024e0e849b0c65cd3
    Reviewed-on: https://chromium-review.googlesource.com/1133299
    Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
    Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#54412}

Refs: 6ee834532d

PR-URL: https://github.com/nodejs/node/pull/22106
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-08-19 00:52:41 +08:00
Andreas Girgensohn
44d04a8c01 doc: clarify documentation of pipes and zlib objects
Document how pipes can be chained in readable.pipe().
Document that zlib.Zlib inherits from stream.Transform.

PR-URL: https://github.com/nodejs/node/pull/22354
Fixes: https://github.com/nodejs/node/issues/22341
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-08-18 11:21:51 +03:00
Sarat Addepalli
9d6619efea doc: add doc for --loader option
PR-URL: https://github.com/nodejs/node/pull/22104
Fixes: https://github.com/nodejs/node/issues/21230
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
2018-08-18 11:15:37 +03:00
Joyee Cheung
7cbbb27c07
src: perform integrity checks on built-in code cache
Currently V8 only checks that the length of the source code is the
same as the code used to generate the hash, so we add an additional
check here:

1. During compile time, when generating node_javascript.cc and
   node_code_cache.cc, we compute and include the hash of the
  (unwrapped) JavaScript source in both.
2. At runtime, we check that the hash of the code being compiled
  and the hash of the code used to generate the cache
  (inside the wrapper) is the same.

This is based on the assumptions:

1. `internalBinding('code_cache_hash')` must be in sync with
   `internalBinding('code_cache')` (same C++ file)
2. `internalBinding('natives_hash')` must be in sync with
   `process.binding('natives')` (same C++ file)
3. If `internalBinding('natives_hash')` is in sync with
   `internalBinding('natives_hash')`, then the (unwrapped)
   code used to generate `internalBinding('code_cache')`
   should be in sync with the (unwrapped) code in
   `process.binding('natives')`

There will be, however, false positives if the wrapper used
to generate the cache is different from the one used at run time,
and the length of the wrapper somehow stays the same.
But that should be rare and can be eased once we make the
two bootstrappers cached and checked as well.

PR-URL: https://github.com/nodejs/node/pull/22152
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
2018-08-18 05:21:52 +08:00