Updated console example to follow style of rest of the examples
PR-URL: https://github.com/nodejs/node/pull/15962
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
There are no longer files in the repository that use the `.markdown`
extension so remove mention of them.
PR-URL: https://github.com/nodejs/node/pull/15786
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Lance Ball <lball@redhat.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
While VM module's columnOffset option does succeed in applying an offset
to the column number in the stack trace, the wavy diagram printed does
not account for potential offsets, resulting in erroneous location of
`^` in the first line of the script.
Before:
```
> vm.runInThisContext('throw new Error()', { columnOffset: 5 })
evalmachine.<anonymous>:1
throw new Error()
^
Error
at evalmachine.<anonymous>:1:12
at ContextifyScript.Script.runInThisContext (vm.js:44:33)
at Object.runInThisContext (vm.js:116:38)
```
After:
```
> vm.runInThisContext('throw new Error()', { columnOffset: 5 })
evalmachine.<anonymous>:1
throw new Error()
^
Error
at evalmachine.<anonymous>:1:12
at ContextifyScript.Script.runInThisContext (vm.js:50:33)
at Object.runInThisContext (vm.js:139:38)
at repl:1:4
```
PR-URL: https://github.com/nodejs/node/pull/15771
Refs: https://github.com/tmpvar/jsdom/pull/2003
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
In code example `vm.createContext` called with new operator by mistake.
It is not a constructor.
PR-URL: https://github.com/nodejs/node/pull/16059
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Currently the variables set in vcbuild.bat are mostly global and
escape/leak out into the calling process. For example, running
vcbuild.bat test and then echoing the config variable gives:
vcbuild.bat test
...
echo %config%
Release
After this change the same command give:
vcbuild.bat test
...
echo %config%
%config%
PR-URL: https://github.com/nodejs/node/pull/15754
Reviewed-By: James M Snell <jasnell@gmail.com>
test-http-server-consumed-timeout will fail if the host is sufficiently
loaded that a 25ms interval takes more than 200ms to be invoked. Skip
the test in that situation.
PR-URL: https://github.com/nodejs/node/pull/15688
Fixes: https://github.com/nodejs/node/issues/14312
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/15738
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
When changing from a recent version, e.g. 8.x to an older branch like 6.x
test artifacts sometimes hang around and cause failures. Using `git clean`
will prevent that from happening.
PR-URL: https://github.com/nodejs/node/pull/15715
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Move the one entry that is not in alphabetical order by GitHub username
in the TSC Emeriti list in README.md.
PR-URL: https://github.com/nodejs/node/pull/15722
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Changes include:
* add words-as-words italics
* remove scare quotes and excessive italics-for-emphasis
* change "is considered to be" and similar to "is"
* change "is X and not not-X" formulations to just "is X"
* change "any and all" to "all"
* remove "sky is blue" paragraph about breaking changes
* general reduction in wordiness
PR-URL: https://github.com/nodejs/node/pull/15629
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
There is no need to reach into quite so many internals to decode an
extension.
PR-URL: https://github.com/nodejs/node/pull/15348
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This accessor exists in OpenSSL 1.0.2, so it may be used already. This
is cherry-picked from PR #8491.
PR-URL: https://github.com/nodejs/node/pull/15348
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
The event manifest specifies the MethodID field as a 32 bit integer.
The 32 bit node executable publishes this correctly, but the 64 bit
executable published a 64 bit integer, making the event undecodable.
PR-URL: https://github.com/nodejs/node/pull/15563
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Hitesh Kanwathirtha <hiteshk@microsoft.com>
PR-URL: https://github.com/nodejs/node/pull/15626
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Turning FIPS mode on (or off) when it's already on (or off) should be a
no-op, not an error.
PR-URL: https://github.com/nodejs/node/pull/12210
Fixes: https://github.com/nodejs/node/issues/11849
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Fixes: https://github.com/nodejs/security/issues/147
PR-URL: https://github.com/nodejs-private/node-private/pull/94
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Doug Wilson <doug@somethingdoug.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This change fixes a potential segfault in the sampling heap profiler.
This landed as part of a larger change upstream [1]. This is the minimal
backport that avoids the segfault.
[1]: https://git.io/vdTYL
PR-URL: https://github.com/nodejs/node/pull/15498
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Adds the following tests for tty readline:
- go to beginning and end of line
- wordLeft
- wordRight
- deleteWordLeft
- deleteWordRight
PR-URL: https://github.com/nodejs/node/pull/12064
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Tries to achieve the same effect as
https://github.com/nodejs/node/pull/13658 without breaking source
tarballs. Presumably if `tools/eslint` wasn't there at all, people
would notice in the PR review!
PR-URL: https://github.com/nodejs/node/pull/15441
Fixes: https://github.com/nodejs/node/issues/14513
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
On a slow/busy machine, `test-http-agent-maxsockets` can fail if the
test takes longer than 5 seconds because that is the default value for
`server.keepAliveTimeout`. Disable `keepAliveTimeout` to make the test
robust.
PR-URL: https://github.com/nodejs/node/pull/15192
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>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
test-tls-fast-writing can fail on a heavily-loaded system due to an
arbitrary 1-second timeout. Remove the arbitrary timeout.
PR-URL: https://github.com/nodejs/node/pull/15138
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR #11705 switched Node away from using using OpenSSL's legacy EVP_Sign*
and EVP_Verify* APIs. Instead, it computes a hash normally via
EVP_Digest* and then uses EVP_PKEY_sign and EVP_PKEY_verify to verify
the hash directly. This change corrects two problems:
1. The documentation still recommends the signature algorithm EVP_MD
names of OpenSSL's legacy APIs. OpenSSL has since moved away from
thosee, which is why ECDSA was strangely inconsistent. (This is why
"ecdsa-with-SHA256" was missing.)
2. Node_SignFinal copied some code from EVP_SignFinal's internals. This
is problematic for OpenSSL 1.1.0 and is missing a critical check
that prevents pkey->pkey.ptr from being cast to the wrong type.
To resolve this, remove the non-EVP_PKEY_sign codepath. This codepath is
no longer necessary. PR #11705's verify half was already assuming all
EVP_PKEYs supported EVP_PKEY_sign and EVP_PKEY_verify. Also, in the
documentation, point users towards using hash function names which are
more consisent. This avoids an ECDSA special-case and some strangeness
around RSA-PSS ("RSA-SHA256" is the OpenSSL name of the
sha256WithRSAEncryption OID which is not used for RSA-PSS).
PR-URL: https://github.com/nodejs/node/pull/15024
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
`test/known_issues/test-stdout-buffer-flush-on-exit.js` is invalid. The
behavior seen currently (with the test failing) is in accordance with
documentation which indicates that calling `process.exit()` may mean
scheduled asynchronous I/O does not happen. The documentation also
indicates that `process.stdout` is asynchronous when it is a POSIX pipe.
PR-URL: https://github.com/nodejs/node/pull/15320
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
`process.md` uses `POSIX` in most places, but `Unix` (and in one case
`Linux`) in a handful of cases where `POSIX` is appropriate. Change
those instances to `POSIX`.
PR-URL: https://github.com/nodejs/node/pull/15321
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
TODO comment from node_crypto is no longer relevant. Unification of
commented code and string_bytes code would bloat the latter. Methods
for hex encoding produce different output in both files (crypto adds
colon and uses uppercase letters.) Common path between those two is
very limited now.
PR-URL: https://github.com/nodejs/node/pull/15104
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>