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>
* 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>
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>
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>
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>
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>
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>
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>
Use the same error code and always emit the error instead of
throwing it.
PR-URL: https://github.com/nodejs/node/pull/18813
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaë Zasso <targos@protonmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
There should be no default error handling when using Http2Stream.
All errors will end up in `'streamError'` on the server anyway,
but they are emitted on `'stream'` as well, otherwise some error
conditions are impossible to debug.
See: https://github.com/nodejs/node/pull/14991
PR-URL: https://github.com/nodejs/node/pull/19232
Reviewed-By: James M Snell <jasnell@gmail.com>
The last promise created by the test for the purposes of making sure
that its type is indeed a promise needs to be resolved so as to avoid
having it left in the pending state at the end of the test.
PR-URL: https://github.com/nodejs/node/pull/19245
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
There’s no need to reset the chunk counter for every write.
PR-URL: https://github.com/nodejs/node/pull/19206
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/19204
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
This commit removes the setting of hook_field[kTotals] to szero in
AsyncHook's enable function.
As far as I can tell this would not be required if the setting of
this field is done with the assignment operator instead of using the
addition assignment operator.
PR-URL: https://github.com/nodejs/node/pull/19219
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Currently, BeforeExitCallback and AtExitCallback are identical apart for
the name of the struct. This commit introduces an ExitCallback struct
with can be used in both cases to avoid the duplication.
PR-URL: https://github.com/nodejs/node/pull/19226
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Currently there are two compiler warnings generated from the addons test
callback-scope:
../binding.cc:44:10:
warning: 'Resolve' is deprecated [-Wdeprecated-declarations]
local->Resolve(v8::Undefined(isolate));
^
../../../../deps/v8/include/v8.h:3893:45:
note: 'Resolve' has been explicitly marked deprecated here
V8_DEPRECATED("Use maybe version", void Resolve(Local<Value> value));
^
../binding.cc:52:54:
warning: 'New' is deprecated [-Wdeprecated-declarations]
persistent.Reset(isolate, v8::Promise::Resolver::New(isolate));
^
../../../../deps/v8/include/v8.h:3880:42:
note: 'New' has been explicitly marked deprecated here
Local<Resolver> New(Isolate* isolate));
This commit updates the test to use non-deprecated functions.
PR-URL: https://github.com/nodejs/node/pull/19252
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
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: Joyee Cheung <joyeec9h3@gmail.com>
Currently there is no member initialiser for emit_env_nonstring_warning_
in the Environment constructor leading to undefined behaviour.
For a debug build, this memory would be initialized:
(lldb) memory read -f x -s 4 -c 1 &emit_env_nonstring_warning_
0x7fff5fbfe254: 0x00000001
But for a release build there will be no such initialization:
(lldb) memory read -f x -s 4 -c 1 `$r12 + 0x46c`
0x7fff5fbfe374: 0x00000000
This can be seen by running test-process-env-deprecation.js using
the Debug build and the Release build.
This commit adds a member initialiser for emit_env_nonstring_warning_
setting it to true.
PR-URL: https://github.com/nodejs/node/pull/19283
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/19247
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/19251
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This makes it easier to use methods from other headers
in the constructor and destructor.
PR-URL: https://github.com/nodejs/node/pull/19202
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Replace the `data_` member of `FSReqBase` by a boolean flag, because
the pointer that `data()` returns is already available through the
`buffer_` member, and set the default size for not requiring an
extra allocation to a more reasonable value, as the input is
usually something like a file path.
PR-URL: https://github.com/nodejs/node/pull/19174
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Rename different parameters with the same names to make it possible
to run tests for url benchmarks.
PR-URL: https://github.com/nodejs/node/pull/19084
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit improves asserion messages in parallel/test-crypto-hash.js.
Instead of just simple string literal, messages are changed to also
include values used in assertion, which should improve debugging
in case of errors.
PR-URL: https://github.com/nodejs/node/pull/18984
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Below syntax errors are handled without force .break/clear
- Unexpected Token (prefix errors)
- missing ) after argument list
In the multiline expression, recoverable errors are truly
recoverable, otherwise syntax error will be thrown.
PR-URL: https://github.com/nodejs/node/pull/18915
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
The documented resolution algorithm started to search for package.json
files prior to searching for file extensions when searching for a
specifier. Oddly, it did not search for index files at same time it
searched for package.json. This restores the documented behavior of
searching for file extensions prior to searching directories.
PR-URL: https://github.com/nodejs/node/pull/15015
Fixes: https://github.com/nodejs/node/issues/14990
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Using `assert.doesNotThrow()` has no benefit over adding a comment
next to some code that should not throw. Therefore it is from now
on discouraged to use it.
PR-URL: https://github.com/nodejs/node/pull/18699
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
The magic mode is long deprecated and works the same as the sloppy
mode. Since the sloppy mode is the default, removing the magic mode
should be safe.
PR-URL: https://github.com/nodejs/node/pull/19187
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
This makes sure util.isDate and util.isRegExp will not abort in case
more than one argument is passed to the utility function.
PR-URL: https://github.com/nodejs/node/pull/19188
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
I haven't seen test-npm-install fail on arm in a long time. There is no
open issue for it being unreliable. Remove flaky designation in
parallel.status file. (If it turns out it is flaky, it's easy enough to
open an issue and restore the flaky designation.)
Ref: https://github.com/nodejs/node/issues/13498
PR-URL: https://github.com/nodejs/node/pull/19216
Refs: https://github.com/nodejs/node/issues/13498
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
In test-tls-wrap-event-emitter, the text of a TypeError is checked as
part of the test. However, this text is generated by the JavaScript
engine (V8) and not Node.js. Thus, we should not check the text as JS
engine error messages can change without it being considered a breaking
change for Node.js.
A side effect is that node-chakracore will no longer need to patch this
test to pass.
PR-URL: https://github.com/nodejs/node/pull/19215
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Adds `TRACING_CATEGORY_NODE`, `TRACING_CATEGORY_NODE1` and
`TRACING_CATEGORY_NODE2` helper macros for consistently building
trace event category strings. For instance,
`TRACING_CATEGORY_NODE2(foo, bar)` would generate the category
string `node,node.foo,node.foo.bar`, such that...
```
TRACE_EVENT_NESTABLE_ASYNC_BEGIN0(
TRACING_CATEGORY_NODE2(foo, bar),
"baz", 1);
```
Would emit if trace events are enabled for categories: `node`,
`node.foo`, or `node.foo.bar`.
This allows a natural scoping down of what trace events a user
may want to receive. Enabling the `node` category would receive
everything Node.js produces.
PR-URL: https://github.com/nodejs/node/pull/19155
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
This commit adds operator overloads for increment/decrement to
AliasedBuffer::Reference.
The motivation for doing this is to hopefully make code that needs
to increment/decrement a little simpler.
PR-URL: https://github.com/nodejs/node/pull/19083
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
test-performance can fail due to resource constraints. Move it from
parallel to sequential so it does not compete with other tests for
resources.
Fixes: https://github.com/nodejs/node/issues/19197
PR-URL: https://github.com/nodejs/node/pull/19228
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/19238
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>