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

21503 Commits

Author SHA1 Message Date
Rich Trott
879f521c65 test: fix flaky test-http2-settings-flood
The test is unreliable on some Windows platforms in its current form.
Make it more robust by using `setInterval()` to repeat the flooding
until an error is triggered.

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

PR-URL: https://github.com/nodejs/node/pull/19349
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2018-03-16 10:26:55 -07:00
Kyle Robinson Young
d20f1f004c doc: fix typos on n-api
PR-URL: https://github.com/nodejs/node/pull/19385
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-03-16 15:36:45 +02:00
Daniel Bevenius
9f3e5a0941 src: remove unused uv.h include from async_wrap.cc
PR-URL: https://github.com/nodejs/node/pull/19342
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Khaidi Chu <i@2333.moe>
2018-03-16 08:11:07 +01:00
Daniel Bevenius
3802e43c0f src: fix indenting of wrap->EmitTraceEventBefore
PR-URL: https://github.com/nodejs/node/pull/19340
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-16 08:02:45 +01:00
Daniel Bevenius
69f8523d83 src: add extractPromiseWrap function
Currently PromiseHook extracts the PromiseWrap from a Local<Promise> in
two places. This commit extracts that code into a function instead.

PR-URL: https://github.com/nodejs/node/pull/19340
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-16 08:02:33 +01:00
Rich Trott
9a70b27254 doc: fix punctuation issue in async_hooks.md
Move period incorrectly placed outside of parentheses to inside the
parentheses. The parenthetical in this case is a full sentence.

PR-URL: https://github.com/nodejs/node/pull/19364
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2018-03-15 14:30:30 -07:00
Kyle Farnung
5fb6f7f22f n-api,test: add int64 bounds tests
Added some simple tests to verify that the int64 API is correctly
handling numbers greater than 32-bits. This is a basic test, but
verifies that an implementer hasn't truncated back to 32-bits.

Refs: https://github.com/nodejs/node-chakracore/pull/496

PR-URL: https://github.com/nodejs/node/pull/19309
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-15 14:17:11 -07:00
Brian White
3c61b87e59
assert: improve assert()/assert.ok() performance
PR-URL: https://github.com/nodejs/node/pull/19292
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-03-15 12:57:35 -04:00
Gireesh Punathil
11b6c0de41 child_process: define EACCES as a runtime error
Access permission on the target child is currently thrown
as an exception. Bring this under the runtime error definition,
much like ENOENT and friends.

PR-URL: https://github.com/nodejs/node/pull/19294
Fixes: https://github.com/nodejs/help/issues/990
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-03-15 20:47:45 +05:30
Joyee Cheung
a1a409a8ca
src: simplify Environment::HandleCleanup
- Make the HandleCleanup a struct, and make the queue a
  std::list, iterate over it in CleanupHandles() and clear
  it after that.
- Put the handle cleanup registration into a method and
  document that they will not be called in the one environemt
  per process setup.

PR-URL: https://github.com/nodejs/node/pull/19319
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jackson Tian <shyvo1987@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-15 15:39:11 +01:00
Joyee Cheung
855dabd675
src: call CleanupHandles in FreeEnvironment
CleanupHandles() has not been called in our own code base anymore
after the v8 debug agent has been removed. It used to be in the
~Environment() destructor but then removed to avoid firing other
events after the exit event, given that we were not going to
clean up handles for the one environment per process setup.
Call it in FreeEnvironment so that embedders can clean up
the handles in the loop when creating multiple environments.

PR-URL: https://github.com/nodejs/node/pull/19319
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jackson Tian <shyvo1987@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-15 15:39:11 +01:00
Michaël Zasso
c6ae8a2810
build: disable V8 untrusted code mitigations
Refs: https://github.com/v8/v8/wiki/Untrusted-code-mitigations

PR-URL: https://github.com/nodejs/node/pull/19222
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Yang Guo <yangguo@chromium.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2018-03-15 14:45:15 +01:00
Michaël Zasso
cac4da05ad
deps: allow disabling V8 untrusted code mitigations
Add a GYP flag similar to the one defined in BUILD.gn.

PR-URL: https://github.com/nodejs/node/pull/19222
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Yang Guo <yangguo@chromium.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2018-03-15 14:45:03 +01:00
Joyee Cheung
54de79b16e
lib: add back lib/module.js redirection
The previous commit deleted lib/module.js so that git
recognize the file move `lib/module.js` ->
`lib/internal/modules/cjs/loader.js`. This commit add the
redirection back.

PR-URL: https://github.com/nodejs/node/pull/19177
Refs: https://github.com/nodejs/node/pull/19112
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2018-03-15 20:50:35 +08:00
Joyee Cheung
c2b01881dc
lib: restructure cjs and esm loaders
Create `lib/internal/modules` and restructure the module loaders
to make the purpose of those files clearer.

Also make it clear in the code that the object exported by
`lib/internal/modules/cjs/loader.js` is `CJSModule` instead of the
ambiguous `Module`.

Before:

```
lib
├── ...
├── internal
│       ├── loaders
│       │     ├── CreateDynamicModule.js
│       │     ├── DefaultResolve.js
│       │     ├── Loader.js
│       │     ├── ModuleJob.js
│       │     ├── ModuleMap.js
│       │     └── Translators.js
│       └── module.js
└── module.js
```

After:

```
lib
├── ...
├── internal
│       ├── ...
│       └── modules
│              ├── cjs
│              │     ├── helpers.js
│              │     └── loader.js
│              └── esm
│                    ├── CreateDynamicModule.js
│                    ├── DefaultResolve.js
│                    ├── Loader.js
│                    ├── ModuleJob.js
│                    ├── ModuleMap.js
│                    └── Translators.js
└── module.js # deleted in this commit to work with git file mode
```

PR-URL: https://github.com/nodejs/node/pull/19177
Refs: https://github.com/nodejs/node/pull/19112
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2018-03-15 20:50:35 +08:00
Joyee Cheung
8484b40b3d
src: put bootstrappers in lib/internal/bootstrap/
Create `lib/internal/bootstrap/` and put bootstrappers there:

Before:

```
lib/internal
├── ...
├── bootstrap_loaders.js
└── bootstrap_node.js
```

After:

```
lib/internal
├── ...
└── bootstrap
    ├── loaders.js
    └── node.js
```

PR-URL: https://github.com/nodejs/node/pull/19177
Refs: https://github.com/nodejs/node/pull/19112
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2018-03-15 20:50:34 +08:00
Joyee Cheung
d9d0a97541
test: remove NODE_DEBUG in global module loading test
Otherwise the debug log output might be mixed up with
the expected errors and the assertion matching the error
message would fail.

PR-URL: https://github.com/nodejs/node/pull/19177
Refs: https://github.com/nodejs/node/pull/19112
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2018-03-15 20:39:31 +08:00
Anna Henningsen
1ac1424476
http: align parser with StreamBase interface changes
The `StreamBase` interface changed, so that `OnStreamRead()`
and `OnStreamAlloc()` are not guaranteed to be emitted in the
same tick any more.

This means that, while it isn’t causing any trouble right now,
we should not assume that it’s safe to return a static buffer
in the HTTP parser’s `OnStreamAlloc()` method.

PR-URL: https://github.com/nodejs/node/pull/18936
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-03-15 12:53:22 +01:00
Anna Henningsen
e136903700
benchmark: remove excessive value from http2 benchmark
`requests = 1000000` took about 10 minutes per run for me
and doesn’t seem to add much value on its own.

PR-URL: https://github.com/nodejs/node/pull/18936
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-03-15 12:53:22 +01:00
Anna Henningsen
d93c48bf61
src: use ObjectTemplate for creating stream req objs
This allows V8 to avoid preparing a execution context
for the constructor, to give a (kinda) small but noticeable
perf gain.

Benchmarks (only this commit):

    $ ./node benchmark/compare.js --new ./node --old ./node-master --filter net-c2s.js --set len=10 --set type=asc --runs 360 net | Rscript benchmark/compare.R
    [01:15:27|% 100| 1/1 files | 720/720 runs | 1/1 configs]: Done
                                             confidence improvement accuracy (*)   (**)  (***)
     net/net-c2s.js dur=5 type='asc' len=10        ***      0.69 %       ±0.31% ±0.41% ±0.53%

PR-URL: https://github.com/nodejs/node/pull/18936
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-03-15 12:53:22 +01:00
Anna Henningsen
12b9ec09b0
http2: remove regular-file-only restriction
Requiring `respondWithFile()` to only work with regular files
is an artificial restriction on Node’s side and has become unnecessary.

Offsets or lengths cannot be specified for those files,
but that is an inherent property of other file types.

PR-URL: https://github.com/nodejs/node/pull/18936
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-03-15 12:53:22 +01:00
Anna Henningsen
1eb6b01fca
http2: use native pipe instead of synchronous I/O
This resolves the issue of using synchronous I/O for
`respondWithFile()` and `respondWithFD()`, and enables
scenarios in which the underlying file does not need
to be a regular file.

PR-URL: https://github.com/nodejs/node/pull/18936
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-03-15 12:53:22 +01:00
Anna Henningsen
67f1d76956
src: introduce native-layer stream piping
Provide a way to create pipes between native `StreamBase` instances
that acts more directly than a `.pipe()` call would.

PR-URL: https://github.com/nodejs/node/pull/18936
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-03-15 12:53:13 +01:00
Anna Henningsen
f7f1437d44
src: add helper for before/after scope without JS calls
Add `AsyncScope` for cases where the async_hooks `before` and
`after` callbacks should be called, to track async context,
but no actual JS is called in between and we can therefore
skip things like draining the microtask or `nextTick` queues.

PR-URL: https://github.com/nodejs/node/pull/18936
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-03-15 12:53:07 +01:00
Anna Henningsen
f734b3eb04
src: give StreamBases the capability to ask for data
Add a `OnStreamWantsWrite()` event that allows streams to
ask for more input data if they want some.

PR-URL: https://github.com/nodejs/node/pull/18936
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-03-15 12:53:06 +01:00
Anna Henningsen
c412150582
src: make FileHandle a (readonly) StreamBase
This enables accessing files using a more standard pattern.

Once some more refactoring has been performed on the other existing
`StreamBase` streams, this could also be used to implement `fs`
streams in a more standard manner.

PR-URL: https://github.com/nodejs/node/pull/18936
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-03-15 12:53:06 +01:00
Anna Henningsen
8695273948
src: tighten handle scopes for stream operations
Put `HandleScope`s and `Context::Scope`s where they are used,
and don’t create one for native stream callbacks automatically.

This is slightly less convenient but means that stream listeners
that don’t actually call back into JS don’t have to pay the
(small) cost of setting these up.

PR-URL: https://github.com/nodejs/node/pull/18936
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-03-15 12:53:06 +01:00
Daniel Bevenius
3ad7c1ae97 test: remove unused deprecation code
Currently there are two tests that specify a third argument, a
deprecation code string, when calling common.expectWarning. The
function only takes two arguments and this third argument is not used.

This commit removes the deprecation code.

PR-URL: https://github.com/nodejs/node/pull/19317
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Jackson Tian <shyvo1987@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2018-03-15 07:20:06 +01:00
Rich Trott
536190f174 doc: improve best practices in onboarding-extras
PR-URL: https://github.com/nodejs/node/pull/19315
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-03-14 22:38:15 -07:00
Rich Trott
e5e0f9f3a8 doc: fix minor issues in async_hooks.md
* easily -> easy
* was -> is
* add a missing comma

PR-URL: https://github.com/nodejs/node/pull/19313
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-03-14 22:36:02 -07:00
Rich Trott
8d336dd8b1 doc: improve text in async_hooks.md
* Remove unnecessary *Note:* designations.
* Various small edits for tone, punctuation, etc.

PR-URL: https://github.com/nodejs/node/pull/19312
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-14 22:29:44 -07:00
Rich Trott
5e23b65a87 test: fix test-cluster-send-handle-large-payload
test-cluster-send-handle-large-payload is susceptible to failure if it
is competing for resources. Move to `sequential` directory so it is not
competing with other tests.

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

PR-URL: https://github.com/nodejs/node/pull/19311
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-03-14 22:28:18 -07:00
Ivan Filenko
a2c0fcc0d8 doc: add returned values and options to stream.md
PR-URL: https://github.com/nodejs/node/pull/19361
Refs: https://github.com/nodejs/node/issues/11135
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
2018-03-15 04:31:04 +02:00
Michael Dawson
cd7d7b15c1 n-api: take n-api out of experimental
Take n-api out of experimental as per:
https://github.com/nodejs/TSC/issues/501

PR-URL: https://github.com/nodejs/node/pull/19262
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2018-03-14 17:12:58 -04:00
Myles Borins
040dd244de
deps: patch V8 to 6.5.254.38
PR-URL: https://github.com/nodejs/node/pull/19303
Refs: https://github.com/v8/v8/compare/6.5.254.31...6.5.254.38
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-03-14 13:46:20 -04:00
Rich Trott
14809aaa98 doc: clarify default TLS handshake timeout
Because the `handshakeTimeout` is in milliseconds, use that unit of
measurement to express the default value.

PR-URL: https://github.com/nodejs/node/pull/19290
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-14 07:50:16 -07:00
Sergey Golovin
4ae320f2b3 path: remove redundant function
PR-URL: https://github.com/nodejs/node/pull/19237
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2018-03-14 22:04:00 +08:00
Vse Mozhet Byt
fa8594779a build: do not cd on vcbuild help
`vcbuild help` just outputs help info and exits.

If a user calls this command not from a project root,
the directory change can be unexpected and unwanted.

PR-URL: https://github.com/nodejs/node/pull/19291
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-14 14:06:04 +02:00
Yuta Hiroto
0a56a1b951 doc: update username and email
PR-URL: https://github.com/nodejs/node/pull/19338
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-14 20:50:29 +09:00
Daniel Bevenius
861285abb5 src: refactor emit before/after/promiseResolve
Currently EmitBefore, EmitAfter, EmitPromiseResolve are very similar.
This commit suggests extracting the code they have in common to a new
function to reduce code duplication.

PR-URL: https://github.com/nodejs/node/pull/19295
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-03-14 10:40:38 +01:00
Ujjwal Sharma
90b0538273 test: use descriptive names for regression tests
Rename the tests appropriately alongside mentioning the subsystem.
Also, make a few basic changes to make sure the tests conform to the
standard test structure.

- Rename test-regress-GH-9819 to test-crypto-tostring-segfault
- Rename test-regress-GH-5051 to test-http-addrequest-localaddress
- Rename test-regress-GH-5727 to test-net-listen-invalid-port
- Rename test-regress-GH-5927 to test-tty-stdin-pipe
- Rename test-regress-GH-6235 to test-v8-global-setter

PR-URL: https://github.com/nodejs/node/pull/19275
Refs: https://github.com/nodejs/node/issues/19105
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-13 20:02:47 +01:00
Ujjwal Sharma
52e869bee8 test: delete test/parallel/test-regress-GH-4948
PR-URL: https://github.com/nodejs/node/pull/19279
Refs: https://github.com/nodejs/node/pull/19275#discussion_r173647620
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-13 15:28:10 +01:00
Rich Trott
8ed0f3409a doc: improve style guide text
* Specify that personal pronouns are OK in colloquial documentation
  rather than just pronouns. Pronouns are OK in all documentation. (For
  example, "it" is a pronoun and is acceptable in all types of
  documentation.) Specify "personal pronouns" for clarity.
* more colloquial -> colloquial
* like -> such as
* Remove "mass nouns" as no mass nouns are given as examples. Plural
  nouns seems to be what was meant, so use that instead.
* Repeat "gender-neutral" to make it clear that it refers to both terms
  and not merely the first term it appears before.
* Remove "non-comprehensive examples". Examples are, by definition,
  non-comprehensive. No need to announce that the examples are examples.
  It is obvious.

PR-URL: https://github.com/nodejs/node/pull/19269
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-03-12 20:27:10 -07:00
Yihong Wang
ffd618bd5c test: shared lib build doesn't handle SIGPIPE
For shared lib build, we leave the signal handling for embedding users.
In these two test cases:
- `parallel/test-process-external-stdio-close-spawn`
- `parallel/test-process-external-stdio-close`

The pipe is used for stdout and is destroied before child process uses
it for logging. So the node executble that uses shared lib build
receives SIGPIPE and the child process ends.

This change ignores the SIGPIPE in node_main.cc for shared lib case.

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

Signed-off-by: Yihong Wang <yh.wang@ibm.com>

PR-URL: https://github.com/nodejs/node/pull/19211
Refs: https://github.com/nodejs/node/issues/18535
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2018-03-12 16:56:04 -07:00
Michaël Zasso
0acdd84026
tools: fix test-npm-package
Migrate the script to the new common tmpDir API.

PR-URL: https://github.com/nodejs/node/pull/19293
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2018-03-12 19:49:27 -04:00
Gus Caplan
cb5f358ee7
vm: add code generation options
Adds options to a VM Context to disable code generation from strings
(such as eval or new Function) and WASM code generation
(WebAssembly.compile).

PR-URL: https://github.com/nodejs/node/pull/19016
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-03-12 14:39:21 -05:00
Taylor Woll
a03c90b661 n-api,test: add a new.target test to addons-napi
Added a N-API test to verify new.target behavior.

PR-URL: https://github.com/nodejs/node/pull/19236
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-03-12 11:49:31 -07:00
cjihrig
22b6804259 lib: define printErr() in script string
This commit moves the printErr() function, used by the
tick profiler processer, into the code string passed to
vm.runInThisContext().

PR-URL: https://github.com/nodejs/node/pull/19285
Fixes: https://github.com/nodejs/node/issues/19260
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-03-12 08:45:13 -07:00
Rich Trott
148d16ab5b doc: do not announce obvious examples
Remove "Examples:" labels that announce things that are clearly
examples.

PR-URL: https://github.com/nodejs/node/pull/19270
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2018-03-12 08:43:13 -07:00
Rich Trott
da226eaa86 test: fix assertion argument order
Fix the assertion argument order so that it will report "actual" and
"expected" correctly when the test fails.

Ref: https://github.com/nodejs/node/issues/19263

PR-URL: https://github.com/nodejs/node/pull/19264
Refs: https://github.com/nodejs/node/issues/19263
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2018-03-12 08:42:21 -07:00