Currently, `Reflect.ownKeys(this)`, `Object.getOwnPropertyNames(this)`
and `Object.getOwnPropertySymbols(this)` when run in a sandbox, fails
to retrieve Symbol and non-enumerable values.
PR-URL: https://github.com/nodejs/node/pull/16410
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This patch fixes the problem with variables that
are declared only on the sandbox but not on the
global proxy.
PR-URL: https://github.com/nodejs/node/pull/16487
Fixes: https://github.com/nodejs/node/issues/12300
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
PR-URL: https://github.com/nodejs/node/pull/16542
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Rather than using `http`, use `_http_client`, etc. directly.
Also moving all the exports to the bottom, in line with most of the rest
of the codebase.
PR-URL: https://github.com/nodejs/node/pull/16395
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Make node_crypto_clienthello-inl.h self-contained.
PR-URL: https://github.com/nodejs/node/pull/16518
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
The previous throws should never happen, and if they do, they
signal a larger issue in core. Make these checks rather than
throws.
PR-URL: https://github.com/nodejs/node/pull/16453
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Libuv 1.15.0 improved console resize detection on Windows. This note is
no longer needed.
PR-URL: https://github.com/nodejs/node/pull/16320
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This is for issue 16452. When 'set-cookie' header is set with an array
that has only one string value, it's split into its individual
characters.
Fix by resetting `isArray` to false when the value is converted from an
array to a string.
Fixes: https://github.com/nodejs/node/issues/16452
PR-URL: https://github.com/nodejs/node/pull/16458
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
PR-URL: https://github.com/nodejs/node/pull/16356
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/16408
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Currently when running the test without an internet connection there are
two JavaScript test failures and one cctest. The cctest only fails on
Mac as far as I know. (I've only tested using Mac and Linux thus far).
This commit moves the two JavaScript tests to test/internet.
The details for test_inspector_socket_server.cc:
[ RUN ] InspectorSocketServerTest.FailsToBindToNodejsHost
make[1]: *** [cctest] Segmentation fault: 11
make: *** [test] Error 2
lldb output:
[ RUN ] InspectorSocketServerTest.FailsToBindToNodejsHost
Process 63058 stopped
* thread #1: tid = 0x7b175, 0x00007fff96d04384
* libsystem_info.dylib`_gai_simple + 87, queue =
* 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1,
* address=0x0)
frame #0: 0x00007fff96d04384 libsystem_info.dylib`_gai_simple + 87
libsystem_info.dylib`_gai_simple:
-> 0x7fff96d04384 <+87>: movw (%rdx), %ax
0x7fff96d04387 <+90>: movw %ax, -0x2a(%rbp)
0x7fff96d0438b <+94>: movq %r13, -0x38(%rbp)
0x7fff96d0438f <+98>: movq 0x18(%rbp), %rcx
(lldb) bt
* thread #1: tid = 0x7b175, 0x00007fff96d04384
* libsystem_info.dylib`_gai_simple + 87, queue =
* 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1,
* address=0x0)
* frame #0: 0x00007fff96d04384 libsystem_info.dylib`_gai_simple + 87
frame #1: 0x00007fff96cfe98b libsystem_info.dylib`search_addrinfo +
179
frame #2: 0x00007fff96cfafef libsystem_info.dylib`si_addrinfo + 2255
frame #3: 0x00007fff96cfa67b libsystem_info.dylib`getaddrinfo + 179
frame #4: 0x00000001017d8888
cctest`uv__getaddrinfo_work(w=0x00007fff5fbfe210) + 72 at
getaddrinfo.c:102
frame #5: 0x00000001017d880e
cctest`uv_getaddrinfo(loop=0x000000010287cb80, req=0x00007fff5fbfe1c8,
cb=0x0000000000000000, hostname="nodejs.org", service="0",
hints=0x00007fff5fbfe268) + 734 at getaddrinfo.c:192
frame #6: 0x000000010171f781
cctest`node::inspector::InspectorSocketServer::Start(this=0x00007fff5fbfe658)
+ 801 at inspector_socket_server.cc:398
frame #7: 0x00000001016ed590
cctest`InspectorSocketServerTest_FailsToBindToNodejsHost_Test::TestBody(this=0x0000000105001fd0)
+ 288 at test_inspector_socket_server.cc:593
I'm not sure about the exact cause for this but when using a standalone
c program to simulate this it seems like when the ai_flags
`AI_NUMERICSERV` is set, which is done in inspector_socket_server.cc
line 394, the servname (the port in the FailsToBindToNodejsHost test) is
expected to be a numeric port string to avoid looking it up in
/etc/services. When the port is 0 as is it was before this commit the
segment fault occurs but not if it is non-zero.
PR-URL: https://github.com/nodejs/node/pull/16255
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Provide `util.isDeepStrictEqual()` that works like
`assert.deepStrictEqual()` but returns a boolean rather than throwing an
error.
Several userland modules have needed this functionality and implemented
it independently. This functionality already exists in Node.js core, so
this exposes it for use by modules. Modules that have needed this
functionality include `lodash`, `concordance` (used by `ava`), and
`qunit`.
PR-URL: https://github.com/nodejs/node/pull/16084
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
The inspector_agent depends on the context still being accessible
during the destructor execution.
PR-URL: https://github.com/nodejs/node/pull/16472
Fixes: https://github.com/nodejs/node/issues/15558
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
The npm install rules had a hidden dependency on the `node` binary
install rule creating the `$PREFIX/bin` directory.
Because with `./configure --shared` no binary is created, the rule
subsequently failed. Fix that by creating the directory before
creating the symlinks to the npm and npx scripts.
(Whether it makes sense to install npm without a `node` binary is
a separate question. This commit is not taking positions. :-))
Regression introduced in commit ed8c89a ("build: fix shared installing
target") which, as the commit log indicates, was itself a bug fix for
the `./configure --shared` install.
PR-URL: https://github.com/nodejs/node/pull/16438
Fixes: https://github.com/nodejs/node/issues/16437
Ref: https://github.com/nodejs/node/pull/15148
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
The commit updates test-require-resolve.js to call toLowerCase on the
resolved module instead of the path. Currently this test will fail if
the path to where node exists contains uppercase letters. For example:
```
$ out/Release/node
test/parallel/test-require-resolve.js
/root/rpmbuild/BUILD/node-v8.8.0/test/parallel
module.js:515
throw err;
^
Error: Cannot find module
'/root/rpmbuild/build/node-v8.8.0/test/fixtures/nested-index/one'
at Function.Module._resolveFilename (module.js:513:15)
at Function.resolve (internal/module.js:18:19)
at Object.<anonymous>
(/root/rpmbuild/BUILD/node-v8.8.0/test/parallel/test-require-resolve.js:37:11)
at Module._compile (module.js:612:30)
at Object.Module._extensions..js (module.js:623:10)
at Module.load (module.js:531:32)
at tryModuleLoad (module.js:494:12)
at Function.Module._load (module.js:486:3)
at Function.Module.runMain (module.js:653:10)
at startup (bootstrap_node.js:187:16)
```
PR-URL: https://github.com/nodejs/node/pull/16486
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>>
Reviewed-By: Anna Henningsen <anna@addaleax.net>>
Reviewed-By: James M Snell <jasnell@gmail.com>>
Stashing it away in internal/buffer so that it can't be used in
userland, but can still be used in internals.
PR-URL: https://github.com/nodejs/node/pull/16391
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Provide section headings for server-side and client side examples.
Add error handling and TLS to server-side example, following example
of `https`. Add error handling, TLS, more efficient Buffer usage,
and header printing to client example.
PR-URL: https://github.com/nodejs/node/pull/16366
Fixes: https://github.com/nodejs/node/issues/16345
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
PR-URL: https://github.com/nodejs/node/pull/16447
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
This commit removes an "empty" comment in node_http2.h that I don't
think was intentional and as far as I can tell not a doxygen comment or
anything like that.
This was not picked up by the cpp linter so a suggestion has also been
added to the CheckComment function to detect these in the future.
PR-URL: https://github.com/nodejs/node/pull/16400
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
The motivation for this commit is that these two test fail on systems
that have different Name Service Switch configuration settings. A
concrete example of this is when using Red Hat Enterprise Linux (RHEL)
7.
If Name Service Switch is available on the operating system then it
might be configured differently (/etc/nsswitch.conf).
If the system is configured with no dns the error code will be
AI_AGAIN, but if there are more services after the dns entry, for
example some linux distributions skip a myhostname service by default
which would still produce the ENOTFOUND error.
This commit suggests checking for either ENOTFOUND or EAI_AGAIN to
accommodate systems like the ones described above. The references below
indicate that others have run, or are running, into this aswell.
Refs: https://github.com/nodejs/node/issues/12075
Refs: https://github.com/nodejs/help/issues/687
Refs: https://github.com/nodejs/node/issues/15825
PR-URL: https://github.com/nodejs/node/pull/16378
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
I hear that varible has an a in it.
PR-URL: https://github.com/nodejs/node/pull/16477
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
This commit removes the unused handle_wrap.h and instead adds uv.h which
is used.
PR-URL: https://github.com/nodejs/node/pull/16379
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
If `stdin` was closed or referred to a file, this didn't work,
because it was accessed via file descriptor.
Instead, use another generic native object.
cherry-picked from https://github.com/ayojs/ayo/pull/63
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/16462
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>