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

22196 Commits

Author SHA1 Message Date
BeniCheni
b4ca3a4dba doc: update examples for fs.access()
PR-URL: https://github.com/nodejs/node/pull/20460
Fixes: https://github.com/nodejs/node/issues/17508
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-04 03:14:35 +03:00
Anna Henningsen
bd20110286
src: refactor BaseObject internal field management
- Instead of storing a pointer whose type refers to the specific
  subclass of `BaseObject`, just store a `BaseObject*` directly.
  This means in particular that one can cast to classes along
  the way of the inheritance chain without issues, and that
  `BaseObject*` no longer needs to be the first superclass
  in the case of multiple inheritance.

  In particular, this renders hack-y solutions to this problem (like
  ddc19be6de) obsolete and addresses
  a `TODO` comment of mine.

- Move wrapping/unwrapping methods to the `BaseObject` class.
  We use these almost exclusively for `BaseObject`s, and I hope
  that this gives a better idea of how (and for what) these are used
  in our code.

- Perform initialization/deinitialization of the internal field
  in the `BaseObject*` constructor/destructor. This makes the code
  a bit more obviously correct, avoids explicit calls for this
  in subclass constructors, and in particular allows us to avoid
  crash situations when we previously called `ClearWrap()`
  during GC.

  This also means that we enforce that the object passed to the
  `BaseObject` constructor needs to have an internal field.
  This is the only reason for the test change.

- Change the signature of `MakeWeak()` to not require a pointer
  argument. Previously, this would always have been the same
  as `this`, and no other value made sense. Also, the parameter
  was something that I personally found somewhat confusing
  when becoming familiar with Node’s code.

- Add a `TODO` comment that motivates switching to real inheritance
  for the JS types we expose from the native side. This patch
  brings us a lot closer to being able to do that.

- Some less significant drive-by cleanup.

Since we *effectively* already store the `BaseObject*` pointer
anyway since ddc19be6de, I do not
think that this is going to have any impact on diagnostic tooling.

Fixes: https://github.com/nodejs/node/issues/18897
PR-URL: https://github.com/nodejs/node/pull/20455
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-05-04 00:57:39 +02:00
Anna Henningsen
a9b0d8235d
src: access ContextifyContext* more directly in property cbs
PR-URL: https://github.com/nodejs/node/pull/20455
Fixes: https://github.com/nodejs/node/issues/18897
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-05-04 00:57:38 +02:00
Anna Henningsen
5512fff623
src: remove kFlagNoShutdown flag
This was originally introduced in 3446ff417b, in order to fix
a hard crash. However, since the libuv 1.18.0 update, that hard
crash is gone, and since f2b9805f85 we do not throw an
error in JS land anymore either, rendering the flag unnecessary.

Also, the original test that checked this condition was added
to `test/parallel/`. Since that typically runs without a TTY stdin,
a duplicate test is being added to the pseudo-tty test suite
in this commit.

Refs: 3446ff417b
Refs: f2b9805f85
Refs: 0e2814179c
PR-URL: https://github.com/nodejs/node/pull/20388
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-05-04 00:57:38 +02:00
Michael Dawson
4740e5dd8a doc: cleanup n-api.md doc
Partial doc cleanup as per
https://github.com/nodejs/node/issues/20421

PR-URL: https://github.com/nodejs/node/pull/20430
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-03 18:53:10 -04:00
Rich Trott
b3c757e07a doc: update Collaborator Guide reference
In pull-requests.md:

* Refer to the Collaborator Guide as Collaborator Guide and not
  Collaborator's Guide. That is how the doc describes itself and we
  should be consistent.

PR-URL: https://github.com/nodejs/node/pull/20473
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-03 13:44:42 -07:00
Gus Caplan
a59826403a
console: console.time() should not reset a timer when it exists
PR-URL: https://github.com/nodejs/node/pull/20442
Fixes: https://github.com/nodejs/node/issues/20440
Refs: https://console.spec.whatwg.org/#time
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-05-03 13:41:49 -05:00
Carrie Coxwell
0930d7ec05
lib: named anonymous functions
PR-URL: https://github.com/nodejs/node/pull/20408
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Matheus Marchini <matheus@sthima.com>
2018-05-03 15:34:03 -03:00
Carrie Coxwell
4d8806fc40
util: named anonymous functions
PR-URL: https://github.com/nodejs/node/pull/20408
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Matheus Marchini <matheus@sthima.com>
2018-05-03 15:33:58 -03:00
Rich Trott
a00f76c360 doc: synchronize argument names for appendFile()
The documentation used `file` for the first argument to `appendFile()`
functions. However, the code and (more importantly) thrown errors
referred to it as `path`. The latter is especially important because
context is not provided. So you're looking for a function that takes
`path` but that string doesn't appear in your code *or* in the
documentation. It's not until the end user looks at the source code of
Node.js that they can figure out what's going on. This is why it is
important that the names of variables in the documentation match that in
the code. If we want to change this to `file`, then that's OK, but we
need to do it in the source code and error messages too, not just in the
docs. Changing the docs is the smallest change to synchronize everything
so that's what this change does.

PR-URL: https://github.com/nodejs/node/pull/20489
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-03 10:59:11 -07:00
Shobhit Chittora
6a24c0c4d6 doc: update cli flag in crypto.md
PR-URL: https://github.com/nodejs/node/pull/20400
Fixes: https://github.com/nodejs/node/issues/20385
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
2018-05-03 17:46:31 +03:00
Anatoli Papirovski
b04d0921ae
util: improve spliceOne perf
Do less variable allocations and reassignments inside spliceOne
since it's relied on by some performance sensitive code.

PR-URL: https://github.com/nodejs/node/pull/20453
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-03 14:47:17 +02:00
Anatoli Papirovski
fe8794560a
events: optimize condition for optimal scenario
Instead of always checking whether we've already warned about a
possible EventEmitter memory leak, first run the rest of the
code as accessing random properties on an Array is expensive.

In addition, remove an unnecessary truthy check.

PR-URL: https://github.com/nodejs/node/pull/20452
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-03 14:45:09 +02:00
Vse Mozhet Byt
2553377d11 doc: add missing periods in documentation.md
PR-URL: https://github.com/nodejs/node/pull/20469
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-03 12:13:40 +03:00
Richard Lau
b457ec8437 test: use fs.copyFileSync()
Use the potentially more efficient fs.copyFileSync() instead of reading
the whole file in and writing the whole file out in JavaScript.

PR-URL: https://github.com/nodejs/node/pull/20340
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-05-02 23:44:47 -07:00
Daylor Yanes
aa18e22a23 test: remove unnecessary strictEqual() argument from remoteClose()
PR-URL: https://github.com/nodejs/node/pull/20343
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-05-02 23:23:18 -07:00
Denis Fäcke
c493b98b0b child_process: name anonymous functions
Refs: https://github.com/nodejs/node/issues/8913

PR-URL: https://github.com/nodejs/node/pull/20399
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-05-02 22:35:35 -07:00
Kyle Martin
482b662cb1 timers: named anonymous functions
PR-URL: https://github.com/nodejs/node/pull/20397
Refs: https://github.com/nodejs/node/issues/8913
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-05-02 22:32:24 -07:00
xsbchen
751c2d6a8d doc: update writing-and-running-benchmarks.md
Refs: 368517c0dc

PR-URL: https://github.com/nodejs/node/pull/20379
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-05-02 22:24:40 -07:00
Richard Lau
ab15198471 tools: fix TypeError from test.py --time
Calculated durations are timedelta objects but the FormatTime function
is expecting a number in seconds.

PR-URL: https://github.com/nodejs/node/pull/20368
Fixes: https://github.com/nodejs/node/issues/20341
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-02 22:22:12 -07:00
Daiki Arai
516349d99c doc: add http.ClientRequest maxHeadersCount
In http.ClientRequest's doc, add maxHeadersCount as a public property.
And in the description of server's one, change a hyphen to a comma.

PR-URL: https://github.com/nodejs/node/pull/20361
Refs: https://github.com/nodejs/node/pull/20359
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-05-02 22:16:51 -07:00
Anatoli Papirovski
a957f248ae
benchmark: fix next-tick-depth
A recent change made these benchmarks fail by always finishing
with 0 iterations. Restore a counter variable.

PR-URL: https://github.com/nodejs/node/pull/20461
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2018-05-03 07:14:40 +02:00
Rich Trott
24a5ac797d doc: add squash guideline to pull-requests doc
Tell the contributor to generally not squash commits during the pull
request review process.

PR-URL: https://github.com/nodejs/node/pull/20413
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-02 19:16:25 -07:00
Rich Trott
ac6d1f20b9 doc: remove squash guideline from onboarding doc
Although I agree with the guideline people should generally not squash
commits in a pull request until the end (in other words, until it's time
to land the PR), it is clear from comments and actions in the issue
tracker that many do not share that view. This is fine by me, but I do
think that we should our documentation should reflect our practices
rather than being an aspirational statement.

If we *do* wish to preserve this recommendation, it probably belongs in
another document anyway as this is not a recommendation for
Collaborators only but for anyone opening a pull request.

PR-URL: https://github.com/nodejs/node/pull/20413
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-02 19:16:07 -07:00
Vse Mozhet Byt
7588ceaf35 doc: add more missing backticks
Also, fix some other nits in passing
(formatting, punctuation, typos, redundancy, obsoleteness).

PR-URL: https://github.com/nodejs/node/pull/20438
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-05-03 02:12:07 +03:00
Gabriel Schulhof
bdf5be98dd n-api: test and doc napi_throw() of a primitive
Ensure that napi_throw() is able to throw a primitive value, and
document that it is able to throw any JavaScript value.

Fixes: https://github.com/nodejs/abi-stable-node/issues/309
PR-URL: https://github.com/nodejs/node/pull/20428
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-05-02 09:23:38 -04:00
Michaël Zasso
9c8b479467 deps: cherry-pick 76cab5f from upstream V8
Original commit message:

    Fix Object.entries/.values with non-enumerable properties

    Iterate over all descriptors instead of bailing out early and missing
    enumerable properties later.

    Bug: chromium:836145
    Change-Id: I104f7ea89480383b6b4b9204942a166bdf8e0597
    Reviewed-on: https://chromium-review.googlesource.com/1027832
    Reviewed-by: Jakob Gruber <jgruber@chromium.org>
    Commit-Queue: Camillo Bruni <cbruni@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#52786}

Refs: 76cab5ff78
Fixes: https://github.com/nodejs/node/issues/20278

PR-URL: https://github.com/nodejs/node/pull/20350
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2018-05-02 14:06:58 +02:00
Daniel Bevenius
557f5702ec http2: reduce require calls in http2/core
This commit removes unnecesary requires of http and internal/util in
http2/core.js

PR-URL: https://github.com/nodejs/node/pull/20422
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-02 08:37:05 +02:00
Daniel Bevenius
04f180122c http2: remove unnecessary v8 qualified names
This commit removes v8 qualified identifiers that have using directives
to be consistent with the rest of the code in node_http2.cc.

PR-URL: https://github.com/nodejs/node/pull/20420
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-05-02 08:26:25 +02:00
Daniel Bevenius
091f999507 http2: remove unused using declarations node_http2
PR-URL: https://github.com/nodejs/node/pull/20420
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-05-02 08:26:12 +02:00
Vse Mozhet Byt
392d80a617 doc: add missing periods or colons
Some other formatting nits were fixed
and some superfluous descriptions were simplified in passing.

PR-URL: https://github.com/nodejs/node/pull/20401
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-05-02 06:17:08 +03:00
Vse Mozhet Byt
536b1fbd3f doc: mitigate marked bug
PR-URL: https://github.com/nodejs/node/pull/20411
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-05-02 06:02:42 +03:00
Vse Mozhet Byt
aaca38a261 doc: specify types of listener parameter
We cannot manage with `{any}` because `message` cannot be
of `Symbol` or `undefined` types.

PR-URL: https://github.com/nodejs/node/pull/20405
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-05-02 05:55:23 +03:00
Vse Mozhet Byt
1c530e89ed tools: dedupe property access in doc/type-parser
There is no need to get this property twice in this rather hot spot:
if there is no such key, the `typeUrl` will be `undefined`,
which suffices for the boolean check in the next line.

For consistency, `undefined` can also be made the default value.

PR-URL: https://github.com/nodejs/node/pull/20387
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-05-02 05:50:01 +03:00
Rich Trott
64a37654ce doc: clarify FileHandle text
There is a paragraph about why the promise-based API uses `FileHandle`
rather than a numeric `fd`. Unfortunately, the paragraph is a bit of
word-salad. Edit it for clarity, grammar, and style.

PR-URL: https://github.com/nodejs/node/pull/20450
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-01 15:48:04 -07:00
Rich Trott
a55c4fdeb1 doc: remove unclear text from fs.write()
There is a paragraph explaining that `fs.write()` cannot write a
substring of the provided string. It's not clear what `buffer` refers
to in that paragraph or even what the purpose of the paragraph is.
There's no suggestion elsewhere that `fs.write()` should be expected to
have a substring feature. Remove the paragraph.

PR-URL: https://github.com/nodejs/node/pull/20450
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-01 15:47:59 -07:00
Rich Trott
f27566f0f2 doc: edit fs.createReadStream() highWaterMark
Shorten the text about the `highWaterMark` value for the stream returned
by `fs.createReadStream()`.

PR-URL: https://github.com/nodejs/node/pull/20450
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-01 15:47:40 -07:00
Ayush Gupta
d3abb60b05 doc: remove redundant table of contents for N-API
Since the table of contents is built dynamically when
building the documentation, the additional table of
contents is redundant and an extra overhead to maintain.

PR-URL: https://github.com/nodejs/node/pull/20395
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-04-30 22:04:58 -07:00
Ujjwal Sharma
e954aa0e0c
doc: add parameters for settings events
Add parameters for the callback for the Http2Session:localSettings event
and Http2Session:remoteSettings event inline with the pattern in the
rest of the documentation.

Refs: https://github.com/nodejs/help/issues/877#issuecomment-381253464

PR-URL: https://github.com/nodejs/node/pull/20371
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-05-01 02:32:00 +05:30
Gabriel Schulhof
d3255cad8e n-api: document the look of napi_external values
Describe what JavaScript values of type `napi_external` look like in
JavaScript.

Fixes: https://github.com/nodejs/abi-stable-node/issues/306
PR-URL: https://github.com/nodejs/node/pull/20426
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-04-30 16:29:03 -04:00
Gabriel Schulhof
8062431491 n-api: document that native strings are copied
Mention that a copy is made of the native string by the
napi_create_string_* APIs.

Fixes: https://github.com/nodejs/abi-stable-node/issues/304
PR-URL: https://github.com/nodejs/node/pull/20425
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-04-30 16:25:45 -04:00
Gabriel Schulhof
20eaee5e18 doc: refine napi_get_property_names() doc
Document that only enumerable, string-keyed properties are returned.

Fixes: https://github.com/nodejs/abi-stable-node/issues/307
PR-URL: https://github.com/nodejs/node/pull/20427
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-04-30 14:00:05 -04:00
Rich Trott
ca80551640 doc: remove "has been known" tentativeness
Remove unnecessary "has been known to" tentativeness from
COLLABORATOR_GUIDE.md. "has been known to" is an awkward replacement for
"can" or "might" or "sometimes does" or "does". Pick the right one and
use it.

PR-URL: https://github.com/nodejs/node/pull/20412
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-04-30 10:44:39 -07:00
Myles Borins
c6d3b37650
2018-04-30, Version 6.14.2 'Boron' (LTS)
Notable Change:

* n-api:
  - n-api has been backported to v6.x. It is being landed as an experimental interface,
    and as such is landing in a Semver-Patch release. (Gabriel Schulhof)
    https://github.com/nodejs/node/pull/19447

PR-URL: https://github.com/nodejs/node/pull/19996
2018-04-30 13:42:22 -04:00
Tobias Nießen
0e63724fe1
crypto: use new OpenSSL constants in CipherBase
This change replaces some constants with better alternatives which were
unavailable in OpenSSL 1.0.2.

PR-URL: https://github.com/nodejs/node/pull/20339
Refs: https://github.com/nodejs/node/pull/19794
Refs: https://github.com/nodejs/node/pull/18138
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-04-30 18:44:10 +02:00
Ruben Bridgewater
109cfa1511
errors: minor (SystemError) refactoring
This removes the former default values and the spread arguments
usage. That was unnecessary and now it does only what is necessary.
The `message` function got renamed to `getMessage` to outline that
it is actually a function and a helper function was inlined into
the SystemError constructor as it was only used there.

PR-URL: https://github.com/nodejs/node/pull/20337
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-04-30 16:51:58 +02:00
Rich Trott
0deb27bd29
test: add dns memory error test
Add test that confirms that when libuv reports a memory error on a DNS
query, that the memory error is passed through and not replaced with
ENOTFOUND.

PR-URL: https://github.com/nodejs/node/pull/20317
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-04-30 16:49:53 +02:00
Ruben Bridgewater
a158d412b3
dns: report out of memory properly
This addresses a part of a TODO by properly reporting an out of
memory error to the user instead of reporting `ENOTFOUND`.

PR-URL: https://github.com/nodejs/node/pull/20317
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-04-30 16:49:52 +02:00
Anna Henningsen
283a967e35
src: avoid std::make_unique
Work around https://github.com/nodejs/build/issues/1254, which
effectively breaks stress test CI and CITGM, by avoiding
`std::make_unique` for now.

This workaround should be reverted once that issue is resolved.

Refs: https://github.com/nodejs/build/issues/1254

PR-URL: https://github.com/nodejs/node/pull/20386
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Matheus Marchini <matheus@sthima.com>
2018-04-29 23:42:42 +02:00
Rich Trott
45c7e03f40 doc: remove parenthetical in onboarding-extras
Remove "(I prefer the former)" from onboarding-extras. Without any
explanation as to why one might prefer A over B, it probably raises more
questions than it answers.

PR-URL: https://github.com/nodejs/node/pull/20393
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-04-29 09:16:05 -07:00