0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 15:30:56 +01:00
Commit Graph

30526 Commits

Author SHA1 Message Date
Pranshu Srivastava
2b50cd7a6d
http: don't throw on Uint8Arrays for http.ServerResponse#write
Don't throw errors on Uint8Arrays and added test for all
valid types.

PR-URL: https://github.com/nodejs/node/pull/33155
Fixes: https://github.com/nodejs/node/issues/33379
Refs: https://github.com/nodejs/node/issues/29829
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-05-16 10:46:10 +02:00
Luigi Pinca
b533fb3508 tools: enable no-else-return lint rule
Refs: https://github.com/nodejs/node/pull/32644
Refs: https://github.com/nodejs/node/pull/32662

PR-URL: https://github.com/nodejs/node/pull/32667
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-05-16 06:42:16 +02:00
Antoine du Hamel
1cb80d1e05 esm: improve commonjs hint on module not found
Adds hint when module specifier is a file URL.

PR-URL: https://github.com/nodejs/node/pull/33220
Fixes: https://github.com/nodejs/node/issues/33219
Reviewed-By: Guy Bedford <guybedford@gmail.com>
2020-05-15 19:09:01 -07:00
Antoine du HAMEL
985e9c5fe5 module: add specific error for dir import
PR-URL: https://github.com/nodejs/node/pull/33220
Fixes: https://github.com/nodejs/node/issues/33219
Reviewed-By: Guy Bedford <guybedford@gmail.com>
2020-05-15 19:08:39 -07:00
Anna Henningsen
0f232ed692
doc: fix stream example
- Un-break the code for multibyte characters
- Get `fs.createReadStream` from the right module

PR-URL: https://github.com/nodejs/node/pull/33426
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-16 02:28:38 +02:00
himself65
21b5c5f9e0
src: replace to CHECK_NOT_NULL in node_crypto
PR-URL: https://github.com/nodejs/node/pull/33383
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2020-05-15 19:39:13 +02:00
Anna Henningsen
e65d189e50
test: regression tests for async_hooks + Promise + Worker interaction
Add regression tests for the case in which an async_hook is enabled
inside a Worker thread and `process.exit()` is called during the
async part of an async function.

This commit includes multiple tests that seem like they should all
crash in a similar way, but interestingly don’t. In particular, it’s
surprising that the presence of a statement after `process.exit()`
in a function has an effect on the kind of crash that’s being
exhibited (V8 DCHECK vs. assertion in our own code) and the
circumstances under which it crashes (e.g. the -1 and -2 tests
can be “fixed” by reverting 13c5a1629c, although they
should have the same behavior as the -3 and -4 tests).

PR-URL: https://github.com/nodejs/node/pull/33347
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
2020-05-15 19:38:26 +02:00
Anna Henningsen
fe4e4ddc71
async_hooks: clear async_id_stack for terminations in more places
Termination exceptions are similar to uncaught exceptions in that they
should clear the async id stack, because no ongoing async callbacks
will be brought to completion when execution terminates.

Previously, there was a check that made sure that that happened when
the termination occurred during the callback itself, but no such check
was in place for the case that the termination occurred during
microtasks started by them. This commit adds such a check, both for
microtasks and the `nextTick` queue. The latter addition doesn’t fix
a crash, but still makes sense conceptually.

The condition here is also flipped from applying only on Worker threads
to also applying on the main thread, and setting the `failed_` flag
rather than reading it. The former makes sense because the public C++
`Stop(env)` API can have the same effect as worker thread termination,
but on the main thread rather than a Worker thread.

PR-URL: https://github.com/nodejs/node/pull/33347
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
2020-05-15 19:38:25 +02:00
Anna Henningsen
dd0980ecc2
worker: call CancelTerminateExecution() before exiting Locker
As the comment indicates, this fixes a DCHECK failure, although I don’t
quite understand why it is happening in the first place.

PR-URL: https://github.com/nodejs/node/pull/33347
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
2020-05-15 19:38:23 +02:00
Anna Henningsen
c7eeef568c
cli: add --trace-atomics-wait flag
Adds a flag that helps with debugging deadlocks due to incorrectly
implemented `Atomics.wait()` calls.

PR-URL: https://github.com/nodejs/node/pull/33292
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2020-05-15 19:37:40 +02:00
Anna Henningsen
d3a8a23089
fs: forbid concurrent operations on Dir handle
libuv does not expect concurrent operations on `uv_dir_t` instances,
and will gladly create memory leaks, corrupt data, or crash the
process.

This patch forbids that, and:

- Makes sure that concurrent async operations are run sequentially
- Throws an exception if sync operations are attempted during an
  async operation

The assumption here is that a thrown exception is preferable to
a potential hard crash.

This fully fixes flakiness from `parallel/test-fs-opendir` when
run under ASAN.

PR-URL: https://github.com/nodejs/node/pull/33274
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-15 19:36:50 +02:00
Anna Henningsen
e9f2937507
fs: clean up Dir.read() uv_fs_t data before calling into JS
A call into JS can schedule another operation on the same `uv_dir_t`.
In particular, when the handle is closed from the callback for a
directory read operation, there previously was a race condition window:

1. A `dir.read()` operation is submitted to libuv
2. The read operation is finished by libuv, calling `AfterDirRead()`
3. We call into JS
4. JS calls dir.close()
5. libuv posts the close request to a thread in the pool
6. The close request runs, destroying the directory handle
7. `AfterDirRead()` is being exited.

Exiting the `FSReqAfterScope` in step 7 attempts to destroy the original
uv_fs_t` from step 1, which now points to an `uv_dir_t` that has
already been destroyed in step 5.

By forcing the `FSReqAfterScope` to clean up before we call into JS,
we can be sure that no other operations on the same `uv_dir_t` are
submitted concurrently.

This addresses issues observed when running with ASAN/valgrind.

PR-URL: https://github.com/nodejs/node/pull/33274
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-15 19:36:48 +02:00
Chris Holland
441e703b28
doc: enhance guides by fixing and making grammar more consistent
PR-URL: https://github.com/nodejs/node/pull/33152
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2020-05-15 19:35:44 +02:00
Rich Trott
23a61eb683 test: fix test-dns-idna2008
The DNS server will sometimes return an IPv6 address (as seen in nightly
CI from time to time). Use `family` option to force IPv4.

PR-URL: https://github.com/nodejs/node/pull/33367
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-05-15 05:48:48 -07:00
Matteo Collina
2d5d77306f Revert "vm: add importModuleDynamically option to compileFunction"
This reverts commit 74c393dd93.

Fixes: https://github.com/nodejs/node/issues/33166

PR-URL: https://github.com/nodejs/node/pull/33364
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.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>
2020-05-15 12:14:35 +02:00
Ruben Bridgewater
24bf1adacc module: do not check circular dependencies for exported proxies
In case the exported module is a proxy that has the `getPrototypeOf`
or `setPrototypeOf` trap, skip the circular dependencies check.
It would otherwise be triggered by the check itself.

Fixes: https://github.com/nodejs/node/issues/33334

Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>

PR-URL: https://github.com/nodejs/node/pull/33338
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
2020-05-15 01:55:28 +02:00
Ruben Bridgewater
50ba066921 repl: improve repl autocompletion for require calls
This improves the autocompletion for require calls. It had multiple
small issues so far. Most important: it won't suggest completions for
require statements that are fully written out. Second, it'll detect
require calls that have whitespace behind the opening bracket. Third,
it makes sure node modules are detected as such instead of only
suggesting them as folders. Last, it adds suggestions for input that
starts with backticks.

Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>

PR-URL: https://github.com/nodejs/node/pull/33282
Fixes: https://github.com/nodejs/node/issues/33238
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-05-15 01:48:40 +02:00
Ruben Bridgewater
4fa7d6e4c4 test: refactor test/parallel/test-bootstrap-modules.js
This simplifies the test a bit by removing duplicated code and by
focusing the reader on the passed through module.

Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>

PR-URL: https://github.com/nodejs/node/pull/33282
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-05-15 01:48:21 +02:00
Ruben Bridgewater
900daedbfe repl: replace hard coded core module list with actual list
This replaces the internally used hard coded Node.js core module
list with the actual internal existent modules. That way all modules
are automatically picked up instead of having to update the list
manually.

This currently only applies to the REPL and to the Node.js `eval`
functionality (User passed `-e` or `--eval` arguments to Node without
`-i` or `--interactive`).

Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>

PR-URL: https://github.com/nodejs/node/pull/33282
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-05-15 01:48:17 +02:00
Ruben Bridgewater
b38d26a168 repl: show reference errors during preview
This aligns the behavior with the one in the Firefox console.
It will visualize ReferenceErrors in case the input has no possible
completion and no buffered input. That way typos can already be
highlighted before being evaluated.

Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>

PR-URL: https://github.com/nodejs/node/pull/33282
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-05-15 01:48:13 +02:00
Ruben Bridgewater
80913e655f repl: improve repl preview
This aligns the REPL preview with the one used in the Chrome
DevTools console. It will now preview the output for the input
including the completion suffix as input. When pressing enter while
previewing such data, it will automatically insert the suffix
before evaluating the input. When pressing escape, that behavior
is deactivated until the input is changed.

Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>

PR-URL: https://github.com/nodejs/node/pull/33282
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-05-15 01:48:08 +02:00
unknown
4780493301
doc: add examples for implementing ESM
Fixes: https://github.com/nodejs/node/issues/28060

PR-URL: https://github.com/nodejs/node/pull/33168
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
2020-05-14 19:57:04 +02:00
Gus Caplan
5ae5262f44
src: add support for TLA
PR-URL: https://github.com/nodejs/node/pull/30370
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
2020-05-14 12:39:23 -05:00
James M Snell
241ed44a0b src: small modification to NgHeader
This is separated out of the QUIC PR. It is not specific to QUIC but
provides a new base class that is used there as an abstraction of
the actual implementation. This is a purely internal implementation
detail that has no outward functional changes (so no need for tests)

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/33289
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
2020-05-14 08:56:41 -07:00
Alba Mendez
1dafaf03cb tls: fix --tls-keylog option
There's a typo that causes only the first socket to be logged
(i.e. when the warning is emitted).

In addition, server sockets aren't logged because `keylog` events
are not emitted on tls.Server, not the socket. This behaviour is
counterintuitive and has caused more bugs in the past, so make all
sockets (server or client) emit 'keylog'. tls.Server will just
re-emit these events.

Refs: https://github.com/nodejs/node/pull/30055
PR-URL: https://github.com/nodejs/node/pull/33366
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2020-05-14 16:52:52 +02:00
Jiawen Geng
4ad26923f4 src: refactor Reallocate since it introduced in upstream v8
PR-URL: https://github.com/nodejs/node/pull/33402
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-14 14:37:58 +00:00
Gus Caplan
eaa16cd477
src: remove deprecated FinalizationRegistry hooks
PR-URL: https://github.com/nodejs/node/pull/33373
Fixes: https://github.com/nodejs/node/issues/33389
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2020-05-13 19:12:11 -05:00
Richard Lau
fcc183c994
build: enable --error-on-warn for POSIX workflows
Treat warnings as errors for non-deps code on Linux and macOS workflows.

Signed-off-by: Richard Lau <riclau@uk.ibm.com>

PR-URL: https://github.com/nodejs/node/pull/33357
Refs: https://github.com/nodejs/node/pull/32685
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2020-05-13 12:07:33 -04:00
Richard Lau
3aa515210a
build: fix --error-on-warn for macOS
XCode builds on macOS do not appear to inherit the `cflags` setting.

Signed-off-by: Richard Lau <riclau@uk.ibm.com>

PR-URL: https://github.com/nodejs/node/pull/33357
Refs: https://github.com/nodejs/node/pull/32685
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2020-05-13 12:07:09 -04:00
Joyee Cheung
365ddb3503
test: refactor WPTRunner
- Print test results as soon as they are available, instead of
  until after all the tests are complete. This helps us printing
  tests whose completion callback is not called because of
  failures.
- Run the scripts specified by `// META: script=` one by one
  instead of concatenating them first for better error stack
  traces.
- Print a status summary when the test process is about to exit.
  This can be used as reference for updating the status file.

For example the stderr output of
`out/Release/node test/wpt/test-console.js` would be:

```
{
  'idlharness.any.js': {
    fail: {
      expected: [
        'assert_equals: operation has wrong .length expected 1 but got 0'
      ]
    }
  }
}
Ran 4/4 tests, 0 skipped, 3 passed, 1 expected failures, 0 unexpected failures
```

PR-URL: https://github.com/nodejs/node/pull/33297
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-05-13 22:10:27 +08:00
Joyee Cheung
d28198b498
test: update WPT interfaces and hr-time
This commit updates the interfaces to
https://github.com/web-platform-tests/wpt/tree/8ada332aea/interfaces
and updates the hr-time test status:

- `window-worker-timeOrigin.window.js` should be skipped because we
  don't implement `Blob`
- `idlharness.any.js` should be skipped since the IDL parser needs
  to be updated, but the parser update would also result in
  an update of the test harness which in turn requires updates of
  other tests. We need to fix the URL implementation first,
  and then update the harness and all the tests.

PR-URL: https://github.com/nodejs/node/pull/33297
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-05-13 22:09:58 +08:00
Daniel Bevenius
e1b90be3b7 src: add primordials to arguments comment
This commit adds the primordials argument to the comment of arguments
passed to bootstrap/node.js.

PR-URL: https://github.com/nodejs/node/pull/33318
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
2020-05-13 09:23:25 +02:00
Daniel Bevenius
7f343c05f4 src: remove unused using declarations in node.cc
PR-URL: https://github.com/nodejs/node/pull/33261
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-05-13 09:18:44 +02:00
Paolo Insogna
5bb4d01fbe doc: add note about clientError writable handling
PR-URL: https://github.com/nodejs/node/pull/33308
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-05-12 20:02:49 +02:00
Michaël Zasso
0ddae48b88
test: stop testing --interpreted-frames-native-stack for s390x
V8 does not support the flag on this architecture anymore.

PR-URL: https://github.com/nodejs/node/pull/32831
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-12 16:14:19 +02:00
Matheus Marchini
aa01fcae49
test: fix test-zlib-unused-weak on V8 8.2
Ref: https://chromium-review.googlesource.com/c/v8/v8/+/1997438
Ref: https://chromium-review.googlesource.com/c/v8/v8/+/2010107
Ref: https://github.com/nodejs/node-v8/issues/144
Signed-off-by: Matheus Marchini <mmarchini@netflix.com>

PR-URL: https://github.com/nodejs/node/pull/32831
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-12 16:14:14 +02:00
Shu-yu Guo
d1156d0d2f
test: rename FinalizationGroup to FinalizationRegistry
PR-URL: https://github.com/nodejs/node/pull/32831
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-12 16:14:11 +02:00
Michaël Zasso
f945c54aa6
deps: V8: cherry-pick 74d50c5063b3
Original commit message:

    FreeBSD: add missing include of pthread_np.h

    This is necessary for the pthread_attr_get_np function.

    Change-Id: I01cfe075a7c86909e8cf37eb7f7c5d44fa044975
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2188310
    Commit-Queue: Michaël Zasso <mic.besace@gmail.com>
    Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
    Auto-Submit: Michaël Zasso <mic.besace@gmail.com>
    Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#67660}

Refs: 74d50c5063

PR-URL: https://github.com/nodejs/node/pull/32831
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-12 16:14:07 +02:00
Michaël Zasso
ae7e45c031
deps: V8: cherry-pick e29c62b74854
Original commit message:

    [arraybuffer] Clean up BackingStore even if it pointer to nullptr

    For a zero-length BackingStore allocation, it is valid for the
    underlying memory to be a null pointer. However, some cleanup
    is still necessary, since the BackingStore may hold a reference
    to the allocator itself, which needs to be released when destroying
    the `BackingStore` instance.

    Change-Id: I1f168079d39e4592d2fde31fbe5f705586690e85
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2169646
    Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
    Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#67420}

Refs: e29c62b748

PR-URL: https://github.com/nodejs/node/pull/32831
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-12 16:14:04 +02:00
Michaël Zasso
7baaab014b
deps: V8: cherry-pick 3f8dc4b2e5ba
Original commit message:

    [intl] Remove soon-to-be removed getAllFieldPositions

    Needed to land ICU67.1 soon.

    Bug: v8:10393
    Change-Id: I3c7737ca600d6ccfdc46ffaddfb318ce60bc7618
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2136489
    Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
    Commit-Queue: Frank Tang <ftang@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#67027}

Refs: 3f8dc4b2e5

PR-URL: https://github.com/nodejs/node/pull/32831
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-12 16:13:56 +02:00
Milad Farazmand
56bdec44a8
deps: V8: cherry-pick e1eac1b16c96
Original commit message:

    Fix compilation error with devtoolset-8

    We are compiling V8 using devtoolset-8 and it is generating a new
    compilation error related to String Truncation:

    error: ‘char* strncpy(char*, const char*, size_t)’ output truncated copying between 1 and 15 bytes from a string of length 15 [-Werror=stringop-truncation]
              strncpy(buffer, unicode_utf8, i);

    Which basically means the null terminating character was not added to
    the end of the buffer:
    https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8/

    This CL will changes 2 uses of "strncpy" to "memcpy" as strings
    are being copied partially and `\n` being added at a later stage.

    Change-Id: I3656afb00463d70ddb8700a487a1978b793e1d09
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2155038
    Reviewed-by: Andreas Haas <ahaas@chromium.org>
    Reviewed-by: Toon Verwaest <verwaest@chromium.org>
    Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
    Cr-Commit-Position: refs/heads/master@{#67277}

Refs: e1eac1b16c

PR-URL: https://github.com/nodejs/node/pull/32831
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-12 16:13:48 +02:00
cjihrig
0d50ba5d48
deps: fix V8 8.3 on SmartOS
PR-URL: https://github.com/nodejs/node/pull/32831
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-12 16:13:44 +02:00
Matheus Marchini
54ae041309
deps: patch V8 to run on Xcode 8
Patch V8 (wasm/wasm-module.cc) to remove const qualifier from type
passed to template call of `OwnedVector::Of`. Xcode 8 can't convert
'OwnedVector<unsigned char>' to 'OwnedVector<const unsigned char>' when
returning from a function (which is likely a bug on Xcode, considering
this worked on the prior version of Xcode as well as newer versions).
This workaround shouldn't affect the application, since the const
qualifier is preserved in the AsmJsOffsetInformation::encoded_offset_.

There's also a V8 test passing a const-qualified type to ::Of, but since
we don't test V8 on Xcode 8, it should be fine to leave it as is.

Signed-off-by: Matheus Marchini <mmarchini@netflix.com>

PR-URL: https://github.com/nodejs/node/pull/32831
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-12 16:13:37 +02:00
Michaël Zasso
e9a6ba0a4c
deps: V8: silence irrelevant warnings
PR-URL: https://github.com/nodejs/node/pull/32831
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-12 16:13:27 +02:00
Joao Reis
32be677f49
deps: make v8.h compatible with VS2015
There is a bug in the most recent version of VS2015 that affects v8.h
and therefore prevents compilation of addons.

Refs: https://stackoverflow.com/q/38378693

PR-URL: https://github.com/nodejs/node/pull/32831
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-12 16:13:22 +02:00
Refael Ackermann
9dfaf49b84
deps: V8: forward declaration of Rtl*FunctionTable
This should be semver-patch since actual invocation is version
conditional.

PR-URL: https://github.com/nodejs/node/pull/32831
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-12 16:13:18 +02:00
Refael Ackermann
55f7ae6386
deps: V8: patch register-arm64.h
Fixes a compilation issue on some platforms

PR-URL: https://github.com/nodejs/node/pull/32831
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-12 16:13:13 +02:00
Ujjwal Sharma
6b5ea2efa2
deps: patch V8 to run on older XCode versions
Patch V8 (compiler/js-heap-broker.cc) to remove the use of an optional
property, which is a fairly new C++ feature, since that requires a newer
XCode version than the minimum requirement in BUILDING.md and thus
breaks CI.

PR-URL: https://github.com/nodejs/node/pull/32831
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-12 16:13:07 +02:00
Refael Ackermann
c3866a1b3e
deps: V8: un-cherry-pick bd019bd
Original commit message:

    [testrunner] delete ancient junit compatible format support

    Testrunner has ancient support for JUnit compatible XML output.

    This CL removes this old feature.

    R=mstarzinger@chromium.org,jgruber@chromium.org,jkummerow@chromium.org
    CC=​machenbach@chromium.org

    Bug: v8:8728
    Change-Id: I7e1beb011dbaec3aa1a27398a5c52abdd778eaf0
    Reviewed-on: https://chromium-review.googlesource.com/c/1430065
    Reviewed-by: Jakob Gruber <jgruber@chromium.org>
    Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
    Commit-Queue: Tamer Tas <tmrts@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#59045}

Refs: bd019bdb72

PR-URL: https://github.com/nodejs/node/pull/32831
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-12 16:12:54 +02:00
cjihrig
a48928836a
deps: update V8 dtrace & postmortem metadata
PR-URL: https://github.com/nodejs/node/pull/32831
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-12 16:12:29 +02:00