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

22234 Commits

Author SHA1 Message Date
Rich Trott
46e6c53de8 doc: edit text for DEP0101
Make the text slightly more concise. Fix awkward verb tense.

PR-URL: https://github.com/nodejs/node/pull/20519
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-07 11:16:36 -07:00
Rich Trott
395c873158 doc: edit text for DEP0104
Make the deprecation message a bit clear and concise.

PR-URL: https://github.com/nodejs/node/pull/20519
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-07 11:16:36 -07:00
Ujjwal Sharma
29ccf6e14b
doc: add parameters for Http2Session:stream event
Add parameters for the callback for the Http2Session:stream 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/20547
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-07 23:45:34 +05:30
Bryan English
90e8f79f65
constants: freeze the constants object
Constants ought to be constant. The primary goal of this commit is to
make constants exposed in require('constants') immutable, as they were
prior to node@7.0.0, and as the constants exposed on fs.constants,
crypto.constants, etc. are.

Since this is implemented by using Object.freeze, it also has the side
effect of making the entire exports of require('constants') immutable,
so no new constants can be defined on the object in userland.

PR-URL: https://github.com/nodejs/node/pull/19813
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-05-07 14:26:11 +02:00
Ruben Bridgewater
8444bba0af
test: fix test-cli-node-options.js on mips
The performance jit logger is not implemented on mips.

PR-URL: https://github.com/nodejs/node/pull/20377
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-05-07 14:25:05 +02:00
Ruben Bridgewater
df2d73d410
test: fix buffer writes on mips
Mips has a different way of handling NaN. This makes sure the tests
pass on MIPS as well.

PR-URL: https://github.com/nodejs/node/pull/20377
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-05-07 14:25:04 +02:00
Ruben Bridgewater
186857f15c
errors: remove ERR_INVALID_ARRAY_LENGTH
This error code is obsolete, since the error message from
ERR_OUT_OF_RANGE is more precise. It was only used a single time,
so I went ahead and replced this.

PR-URL: https://github.com/nodejs/node/pull/20484
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-07 14:23:29 +02:00
Ruben Bridgewater
28a54cb83a
doc: clearer doc-only deprecations
Explicitely mention that a documentation only deprecation does not
always imply that it will be staged for deprecation in a future
Node.js major release. It is mainly there to tell developers that
a specific API should be avoided.

PR-URL: https://github.com/nodejs/node/pull/20381
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-07 14:20:47 +02:00
Vse Mozhet Byt
974df9c2be
tools: remove redundant code in doc/html.js
This PR reduces code by 40 lines and docs size by ~7.5 KB. Only
<div class="signature">...</div> wrappers are removed from docs,
no other changes are found in results.

PR-URL: https://github.com/nodejs/node/pull/20514
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-07 10:43:43 +02:00
Yichao 'Peak' Ji
2a96ee284c
url: fix WHATWG host formatting error
The current url.format implementation will return an invalid URL string
without the host if there is a port and unicode: true.

This unexpected behavior is caused by domainToUnicode, which expects
a hostname instead of a host string according to node_url.cc.

Adds both a fix and a test for the issue.

PR-URL: https://github.com/nodejs/node/pull/20493
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: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2018-05-07 10:32:22 +02:00
Brian White
8f6ab9f799
Revert "stream: prevent 'end' to be emitted after 'error'"
This reverts commit 0857790656.

PR-URL: https://github.com/nodejs/node/pull/20449
Fixes: https://github.com/nodejs/node/issues/20334
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-05-07 09:44:26 +02:00
Shobhit Chittora
5efbe4c1e8 doc: update one more command in crypto.md
PR-URL: https://github.com/nodejs/node/pull/20500
Refs: https://github.com/nodejs/node/pull/20400
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-07 04:09:28 +03:00
Allen Yonghuang Wang
b00c34c161
src: add public API to expose the main V8 Platform
Add an API to get MultiIsolatePlatform used in node main thread.

PR-URL: https://github.com/nodejs/node/pull/20447
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-05-06 23:34:09 +02:00
Daniel Bevenius
c8f8847120
doc: add snake_case section for C-like structs
This commit adds a section mentioning that for C-like structs it is
alright to use snake_case.

PR-URL: https://github.com/nodejs/node/pull/20423
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-05-06 21:38:00 +02:00
Daniel Bevenius
2c5b94f390
http2: rename http2_state class to Http2State
This commit renames the http2_state class to follow the guidelines in
CPP_STYLE_GUIDE.md.

PR-URL: https://github.com/nodejs/node/pull/20423
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-05-06 21:37:55 +02:00
Ruben Bridgewater
8f1ee0bc6f
errors: remove dead code
This was never falsy, since an array length can only be an integer.

PR-URL: https://github.com/nodejs/node/pull/20483
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
2018-05-06 21:17:59 +02:00
Daniel Bevenius
161182ec05
tls: remove sharedCreds in Server constructor
This commit removes the var sharedCreds which is just reassigned to
this._sharedCreds in the following line.

PR-URL: https://github.com/nodejs/node/pull/20491
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-05-06 21:13:31 +02:00
Shobhit Chittora
a1f342f054
doc: updates crypto doc with openssl list -cipher-algorithms
PR-URL: https://github.com/nodejs/node/pull/20502
Refs: https://github.com/nodejs/node/issues/20385
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
2018-05-06 21:09:33 +02:00
Gabriel Schulhof
4692cf4ebb doc: fix N-API property descriptor documentation
PR-URL: https://github.com/nodejs/node/pull/20433
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-05-06 12:25:16 -04:00
Anatoli Papirovski
34bd9f318a
benchmark: track exec time in next-tick-exec
The next-tick-exec benchmarks were meant to track nextTick execution
time but due to an error, they actually track addition and execution.

PR-URL: https://github.com/nodejs/node/pull/20462
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-06 07:29:47 +02:00
Anatoli Papirovski
491ae12e41
tls: cleanup onhandshakestart callback
Re-arrange and cleanup the flow of the onhandshakestart to be
more clear and less repetitive. Exit early in the case of a
first ever handshake for a given connection.

PR-URL: https://github.com/nodejs/node/pull/20466
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-05-06 07:28:26 +02:00
Anatoli Papirovski
9a3ae2fe9d
lib: expose FixedQueue internally and fix nextTick bug
A bug was introduced together with the FixedQueue implementation for
process.nextTick which meant that the queue wouldn't necessarily
fully clear on each run through. Fix it and abstract the data
structure into an internal module that can later be used elsewhere.

PR-URL: https://github.com/nodejs/node/pull/20468
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-05-06 07:21:32 +02:00
Masashi Hirano
6ec43fc28b
test: fix common.canCreateSymLink() on non-Windows
test/common/README.md indicates that canCreateSymlink() always returns
true on non-Windows platforms. However, prior to this commit, undefined
was being returned. This commit aligns the implementation with the
docs by returning true.

PR-URL: https://github.com/nodejs/node/pull/20511
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-05-05 10:38:44 -04:00
Brandon Ruggles
64348f5ea5
src: removed unnecessary prototypes from Environment::SetProtoMethod
Added an optional parameter of type v8::ConstructorBehavior to
Environment::NewFunctionTemplate, defaulting to
v8::ConstructorBehavior::kAllow. Also modified
Environment::SetProtoMethod to pass
v8::ConstructorBehavior::kThrow to its
call to Environment::NewFunctionTemplate.

Fixes: https://github.com/nodejs/node/issues/17668
Refs: https://github.com/nodejs/node/pull/20321
PR-URL: https://github.com/nodejs/node/pull/20321
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: Ben Noordhuis <info@bnoordhuis.nl>
2018-05-05 14:02:37 +02:00
Daiki Arai
67790962da
https: defines maxHeadersCount in the constructor
In Refs, http.Server's maxHeadersCount field was defined in the
constructor to make hidden class stable and so on. Also in https.Server,
we can use maxHeadersCount the same as http via connectionListener. So,
defines it in the constructor and documentation.

Refs: https://github.com/nodejs/node/pull/9116

PR-URL: https://github.com/nodejs/node/pull/20359
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-05 13:57:07 +02:00
Jérémy Lal
c6a42868c8
doc: fix manpage warning
LC_ALL=C.UTF-8 MANROFFSEQ='' MANWIDTH=80 man --warnings -E UTF-8 -l -Tutf8 -Z ./doc/node.1 > /dev/null
mdoc warning: Empty input line #389

PR-URL: https://github.com/nodejs/node/pull/20383
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Rich Trott <rtrott@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-05-05 13:51:41 +02:00
Ruben Bridgewater
c71b97303c
build: check for different deprecation signatures
Right now we strictly test for `DEP00XX`. We are already above that
number of deprecations and it is better to have a wildcard for the
first three numbers. Only the last character has to match the X to
print a warning.

PR-URL: https://github.com/nodejs/node/pull/20384
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-05-05 13:50:17 +02:00
Yang Guo
4546ad2784
src: fix inconsistency in extern declaration
NodeCounterProvider is declared as extern but defined as EXTERN_C.
This confuses clang-cl.

PR-URL: https://github.com/nodejs/node/pull/20436
Refs: https://github.com/nodejs/node/issues/19630
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2018-05-05 13:47:43 +02:00
Gabriel Schulhof
3b60fc2b9b
test: fix up N-API error test
Replace assert.throws() with an explicit try/catch in order to catch
the thrown value and be able to compare it strictly to an expected
value.

Re: https://github.com/nodejs/node/pull/20428#issuecomment-386160684

PR-URL: https://github.com/nodejs/node/pull/20487
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-05 13:44:03 +02:00
Rich Trott
2fda625b20
test: rename misnamed test
Rename test-fs-chdir-errormessage.js to
test-process.chdir-errormessage.js. The test is for process.chdir().
There is no fs.chdir().

PR-URL: https://github.com/nodejs/node/pull/20532
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-05 13:41:57 +02:00
cjihrig
17a4421b69
repl: add spaces to load/save messages
PR-URL: https://github.com/nodejs/node/pull/20536
Reviewed-By: Michaël Zasso <targos@protonmail.com>
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: Anna Henningsen <anna@addaleax.net>
2018-05-05 13:39:11 +02:00
Masashi Hirano
f74b344a24 test: add fs/promises filehandle stat test
Added test for fs/promises filehandle stat.

PR-URL: https://github.com/nodejs/node/pull/20492
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-05 04:12:42 -07:00
Anna Henningsen
d7cba76856
src: more automatic memory management in node_crypto.cc
Prefer custom smart pointers fitted to the OpenSSL data structures
over more manual memory management and lots of `goto`s.

PR-URL: https://github.com/nodejs/node/pull/20238
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-05 01:40:21 +02:00
Ayush Gupta
1cf7ef6433 doc: document using domain in REPL
Document that REPL uses the `domain` module to handle uncaught
exceptions, and the side effects caused by it.

PR-URL: https://github.com/nodejs/node/pull/20382
Fixes: https://github.com/nodejs/node/issues/19998
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-04 23:05:56 +03:00
Rich Trott
2d609c5d53 doc: fix mkdtemp() documentation
Several minor fixes to the entries for `mkdtemp()`. The most significant
is that a mistaken use of `fs.mkdtemp()` is corrected to
`fsPromises.mkdtemp()`.

PR-URL: https://github.com/nodejs/node/pull/20512
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
2018-05-04 09:30:29 -07:00
Myles Borins
17cb5ad2d2
deps: patch V8 to 6.6.346.27
PR-URL: https://github.com/nodejs/node/pull/20480
Refs: https://github.com/v8/v8/compare/6.6.346.24...6.6.346.27
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2018-05-04 11:37:40 -04:00
Yihong Wang
f7cdeba548
crypto: allocate more memory for cipher.update()
For key wrapping algorithms, calling EVP_CipherUpdate() with null output
could obtain the size for the ciphertext. Then use the returned size to
allocate output buffer. Also add a test case to verify des3-wrap.

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

PR-URL: https://github.com/nodejs/node/pull/20370
Fixes: https://github.com/nodejs/node/issues/19655
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-04 11:16:16 +02:00
Gabriel Schulhof
cd8ed1c447 n-api: make test_error functions static
PR-URL: https://github.com/nodejs/node/pull/20373/
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-05-03 22:53:53 -04:00
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