PR-URL: https://github.com/nodejs/node/pull/48788
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Original commit message:
Fix mistake in the skip branch of test/mjsunit/regress-1320641.js
It was doing a `string.test(regex)` which was wrong. It's supposed
to be `regex.test(string)`. It wasn't caught in the CI because
the skip path is not normally taken in the V8 CI.
Change-Id: Id1bdab5bbc41968bba8adc1cb3664e8f95fb5d72
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4697855
Commit-Queue: Joyee Cheung <joyee@igalia.com>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#89044}
Refs: 9f4b7699f6
PR-URL: https://github.com/nodejs/node/pull/48830
Refs: c1a54d5ffc
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
Major functional changes:
- Allow `import()` to work within loaders that require other loaders,
- Unflag the use of `Module.register`.
A new interface `Customizations` has been created in order to unify
`ModuleLoader` (previously `DefaultModuleLoader`), `Hooks` and
`CustomizedModuleLoader` all of which now implement it:
```ts
interface LoadResult {
format: ModuleFormat;
source: ModuleSource;
}
interface ResolveResult {
format: string;
url: URL['href'];
}
interface Customizations {
allowImportMetaResolve: boolean;
load(url: string, context: object): Promise<LoadResult>
resolve(
originalSpecifier:
string, parentURL: string,
importAssertions: Record<string, string>
): Promise<ResolveResult>
resolveSync(
originalSpecifier:
string, parentURL: string,
importAssertions: Record<string, string>
) ResolveResult;
register(specifier: string, parentUrl: string): any;
forceLoadHooks(): void;
importMetaInitialize(meta, context, loader): void;
}
```
The `ModuleLoader` class now has `setCustomizations` which takes an
object of this shape and delegates its responsibilities to this object
if present.
Note that two properties `allowImportMetaResolve` and `resolveSync`
exist now as a mechanism for `import.meta.resolve` – since `Hooks`
does not implement `resolveSync` other loaders cannot use
`import.meta.resolve`; `allowImportMetaResolve` is a way of checking
for that case instead of invoking `resolveSync` and erroring.
Fixes https://github.com/nodejs/node/issues/48515
Closes https://github.com/nodejs/node/pull/48439
PR-URL: https://github.com/nodejs/node/pull/48559
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
- refactor table so that it does not grow for
every new version of Node.js
- refer to latest version of table as the canonical
reference
- add info for Node-API v9
Refs: https://github.com/nodejs/node/issues/48277
Signed-off-by: Michael Dawson <mdawson@devrus.com>
PR-URL: https://github.com/nodejs/node/pull/48774
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Adding the per-realm binding data tracking introduced a call to a realm
method when realm was potentially null. This is triggered whenever the
function is called from `ContextifyContext::New` which passes `nullptr`
as the `realm`.
PR-URL: https://github.com/nodejs/node/pull/48802
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Example is not runnable because `path` is used, but it's not
declared.
PR-URL: https://github.com/nodejs/node/pull/48556
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/48817
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
PR-URL: https://github.com/nodejs/node/pull/48709
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
The test test/parallel/test-experimental-shared-value-conveyor.js was
added to test the --harmony-struct feature of V8. However, when used
with pointer compression, the process crashes. This commit skips
the test for pointer compression builds. This change uses a child
process because starting a Node pointer compression build with
--harmony-struct immediately crashes the process. Once this crash
is addresses, this commit can be reverted.
PR-URL: https://github.com/nodejs/node/pull/48738
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
... as it's not valid implementation and also has not been used
PR-URL: https://github.com/nodejs/node/pull/48732
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Mark URL/URLSearchParams as uncloneable and untransferable to reject
them in `structuredClone` and `port.postMessage`.
PR-URL: https://github.com/nodejs/node/pull/47497
Refs: https://github.com/nodejs/node/pull/47214
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/48751
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
* The first argument `node` should be a const pointer.
* The second argument `spaces` should not be a signed integer type.
* The local variable `child` should be size_t.
* The local variable `pair` in the range declaration should be a
reference type to avoid copying the object.
Refs: https://github.com/nodejs/node/pull/48677
PR-URL: https://github.com/nodejs/node/pull/48770
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
PR-URL: https://github.com/nodejs/node/pull/48726
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Removes flakiness from the mentioned test due to the x86 memory limit
PR-URL: https://github.com/nodejs/node/pull/48750
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Previously we just rely on the unordered_set order to iterate over
the BaseObjects, which is not deterministic.
The iteration is only used in printing, verification, and snapshot
generation. In the first two cases the performance overhead of
sorting does not matter because they are only used for debugging.
In the last case the determinism is more important than the trivial
overhead of sorting. So this patch makes the iteration deterministic
by sorting the set first, as what is already being done when we
drain the queue.
PR-URL: https://github.com/nodejs/node/pull/48702
Refs: https://github.com/nodejs/build/issues/3043
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Fixes target toolchain arguments being passed to the host toolchain when
cross-compiling. For example, -m64 is not available on aarch64.
PR-URL: https://github.com/nodejs/node/pull/48597
Reviewed-By: Richard Lau <rlau@redhat.com>
When piping a paused Readable to a full Writable we didn't
register a drain listener which cause the src to never
resume.
Refs: https://github.com/nodejs/node/issues/48666
PR-URL: https://github.com/nodejs/node/pull/48691
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/48692
Fixes: https://github.com/nodejs/node/issues/48688
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/48713
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Sometimes the test completes with only two data chunks received on the
client.
Fixes: https://github.com/nodejs/node/issues/40507
PR-URL: https://github.com/nodejs/node/pull/48599
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
The test is not very resource intensive. It just writes data to a TCP
socket until backpressure is reached. Move it parallel.
PR-URL: https://github.com/nodejs/node/pull/48599
Fixes: https://github.com/nodejs/node/issues/40507
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>