Chengzhong Wu
a0ff00b526
src: avoid draining platform tasks at FreeEnvironment
...
At the point of `FreeEnvironment` and onwards, no JavaScript execution
associated with the Environment should be triggered.
Avoid draining platform tasks that can trigger JavaScript execution in
`FreeEnvironment`. The holder of `node::Environment` should immediately
call `node::MultiIsolatePlatform::UnregisterIsolate` and
`v8::Isolate::Dispose` to cancel pending foreground tasks and join
concurrent tasks after the environment was freed.
`NodePlatform` can properly handle the case in `RunForegroundTask` when
an Isolate out-lives its associated `node::Environment`.
PR-URL: https://github.com/nodejs/node/pull/51290
Fixes: https://github.com/nodejs/node/issues/47748
Fixes: https://github.com/nodejs/node/issues/49344
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2024-01-11 10:10:24 -03:00
Rafael Gonzaga and Carlos Espa
416b4f8063
lib,src,permission: port path.resolve to C++
...
Co-Authored-By: Carlos Espa <cespatorres@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/50758
Refs: https://github.com/nodejs/security-wg/issues/898
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Claudio Wunder <cwunder@gnome.org >
2024-01-02 15:05:28 -03:00
Alexander Jones
85ee2f7255
test: replace forEach() with for...of
...
Replace `Array.prototype.forEach()` with `for...of` in
`parallel/test-whatwg-encoding-custom-textdecoder-utf16-surrogates.js`.
PR-URL: https://github.com/nodejs/node/pull/50608
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-01-02 15:05:28 -03:00
Ospite Privilegiato
549e4b4142
test: replace forEach with for...of
...
Replace `Array.prototype.forEach()` with `for...of` in
`test/parallel/test-fs-readv-sync.js` and
`test/parallel/test-fs-readv.js`.
PR-URL: https://github.com/nodejs/node/pull/50787
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
2024-01-02 15:05:28 -03:00
lucacapocci94-dev
ef44f9bef2
test: replace foreach with for of
...
PR-URL: https://github.com/nodejs/node/pull/50790
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-01-02 15:05:28 -03:00
翠 / green
091098f40a
fs: fix fs.promises.realpath for long paths on Windows
...
Unlike other fs functions that work with paths, realpath isn't
using pathModule.toNamespacedPath prior to calling libuv function. This
is causing issues on windows.
Windows long path test is also improved to cover the mentioned issue.
Fixes: https://github.com/nodejs/node/issues/51031
PR-URL: https://github.com/nodejs/node/pull/51032
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-01-02 15:05:27 -03:00
Jia
652af45485
test: replace forEach() with for...of
...
Replace `forEach()` with `for...of` in
`test/parallel/test-assert-typedarray-deepequal.js`.
PR-URL: https://github.com/nodejs/node/pull/50610
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-01-02 15:05:27 -03:00
James M Snell
5b32e21f3b
quic: add quic internalBinding, refine Endpoint, add types
...
PR-URL: https://github.com/nodejs/node/pull/51112
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2024-01-02 15:05:27 -03:00
James M Snell
e443953656
stream: fix cloned webstreams not being unref'd
...
When cloning a `ReadableStream` and `WritableStream`, both use an
internal `MessageChannel` to communicate with the original stream.
Those, however, previously were not unref'd which would lead to the
process not exiting if the stream was not fully consumed.
Fixes: https://github.com/nodejs/node/issues/44985
PR-URL: https://github.com/nodejs/node/pull/51255
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com >
2024-01-02 15:05:26 -03:00
Pulkit Gupta
979cebc955
test_runner: fixed test object is incorrectly passed to setup()
...
PR-URL: https://github.com/nodejs/node/pull/50982
Reviewed-By: Raz Luvaton <rluvaton@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2024-01-02 15:05:26 -03:00
Marco Mac
aaf710f535
test: replace forEach test-http-server-multiheaders2
...
PR-URL: https://github.com/nodejs/node/pull/50794
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-01-02 15:05:26 -03:00
uzlopak
941aedc6fc
errors: fix stacktrace of SystemError
...
PR-URL: https://github.com/nodejs/node/pull/49956
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-01-02 15:05:26 -03:00
theanarkh
17c73e6d0c
src: fix unix abstract socket path for trace event
...
PR-URL: https://github.com/nodejs/node/pull/50858
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-01-02 15:05:26 -03:00
Antoine du Hamel
624142947f
lib: fix use of --frozen-intrinsics with --jitless
...
PR-URL: https://github.com/nodejs/node/pull/51248
Fixes: https://github.com/nodejs/node/issues/51232
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-01-02 15:05:26 -03:00
Marco Ippolito
c31ed51373
timers: export timers.promises
...
PR-URL: https://github.com/nodejs/node/pull/51246
Fixes: https://github.com/nodejs/node/issues/51237
Reviewed-By: Raz Luvaton <rluvaton@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2024-01-02 15:05:26 -03:00
Pulkit Gupta
e5a8fa01aa
fs: make offset, position & length args in fh.read() optional
...
PR-URL: https://github.com/nodejs/node/pull/51087
Fixes: https://github.com/nodejs/node/issues/47183
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-01-02 15:05:25 -03:00
Chiara Ricciardi
57c64550cc
test: replace forEach with for-of in test-webcrypto-export-import-ec
...
PR-URL: https://github.com/nodejs/node/pull/51249
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-01-02 15:05:25 -03:00
Luca Del Puppo
88e865181b
test: move to for of loop in test-http-hostname-typechecking.js
...
PR-URL: https://github.com/nodejs/node/pull/50782
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
2024-01-02 15:05:25 -03:00
Ianna83
38232d1c52
test: replace forEach with for of in file test-trace-events-net.js
...
PR-URL: https://github.com/nodejs/node/pull/50789
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-01-02 15:05:25 -03:00
Edoardo Dusi
f1cb58355a
test: replace forEach() with for...of in test/parallel/test-util-log.js
...
PR-URL: https://github.com/nodejs/node/pull/50783
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-01-02 15:05:25 -03:00
Andrea Pavone
9bfd84c117
test: replace forEach with for of in test-trace-events-api.js
...
PR-URL: https://github.com/nodejs/node/pull/50784
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-01-02 15:05:25 -03:00
Luigi Pinca
c7a135962d
http: remove misleading warning
...
There are cases where the `'clientError'` event can be emitted multiple
times, even if the socket is correctly destroyed.
Fixes: https://github.com/nodejs/node/issues/51073
PR-URL: https://github.com/nodejs/node/pull/51204
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
2024-01-02 15:05:25 -03:00
Rafael Gonzaga
a69c7d7bc3
src,permission: add --allow-addon flag
...
PR-URL: https://github.com/nodejs/node/pull/51183
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
2024-01-02 15:05:24 -03:00
Rafael Gonzaga
8ff6bc45ca
lib,permission: handle buffer on fs.symlink
...
PR-URL: https://github.com/nodejs/node/pull/51212
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
2024-01-02 15:05:24 -03:00
Rafael Gonzaga
8f4325dcd5
permission: fix wildcard when children > 1
...
PR-URL: https://github.com/nodejs/node/pull/51209
Fixes: https://github.com/nodejs/node/issues/50659
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2024-01-02 15:05:24 -03:00
Chengzhong Wu
291265ce27
lib: expose default prepareStackTrace
...
Expose the default prepareStackTrace implementation as
`Error.prepareStackTrace` so that userland can chain up formatting of
stack traces with built-in source maps support.
PR-URL: https://github.com/nodejs/node/pull/50827
Fixes: https://github.com/nodejs/node/issues/50733
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
2024-01-02 15:05:24 -03:00
legendecas
3310095bea
repl: fix prepareStackTrace frames array order
...
The second parameter of `Error.prepareStackTrace` is an array of
reversed call site frames.
PR-URL: https://github.com/nodejs/node/pull/50827
Fixes: https://github.com/nodejs/node/issues/50733
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
2024-01-02 15:05:24 -03:00
Mattia Iannone
7e9834915a
test: replace forEach with for-of in test-v8-serders.js
...
PR-URL: https://github.com/nodejs/node/pull/50791
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
2024-01-02 15:05:24 -03:00
Paolo Insogna
e4be5b60f0
net: add connection attempt events
...
PR-URL: https://github.com/nodejs/node/pull/51045
Fixes: https://github.com/nodejs/node/issues/48763
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
2024-01-02 15:05:24 -03:00
KuthorX
a325746ff4
http: do not override user-provided options object
...
PR-URL: https://github.com/nodejs/node/pull/33633
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-01-02 15:05:23 -03:00
Yagiz Nizipli
5b229d775f
fs: validate fd synchronously on c++
...
PR-URL: https://github.com/nodejs/node/pull/51027
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2024-01-02 15:05:22 -03:00
Marten Richter
89eee7763f
http2: addtl http/2 settings
...
Currently, node.js http/2 is limited in sending SETTINGs,
that are currently implemented by nghttp2.
However, nghttp2 has the ability to send arbitary SETTINGs,
that are not known beforehand.
This patch adds this feature including a fall back mechanism,
if a SETTING is implemented in a later nghttp2 or node version.
Fixes: https://github.com/nodejs/node/issues/1337
PR-URL: https://github.com/nodejs/node/pull/49025
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
2024-01-02 15:05:22 -03:00
Filip Skokan
13a1241b83
assert,crypto: make KeyObject and CryptoKey testable for equality
...
PR-URL: https://github.com/nodejs/node/pull/50897
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2024-01-02 15:05:22 -03:00
Joyee Cheung
e54ddf898f
src: support configurable snapshot
...
- Add support for --build-snapshot-config which allows passing
snapshot configurations via a JSON configuration file.
- Add support for node::SnapshotConfig in the embedder API
The initial configurable options are:
- "builder" (SnapshotConfig::builder_script_path): path to the
builder script.
- "withoutCodeCache" (SnapshotFlags::kWithoutCodeCache): disable
code cache generation.
PR-URL: https://github.com/nodejs/node/pull/50453
Refs: https://github.com/nodejs/node/issues/42566
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
2024-01-02 15:05:22 -03:00
Pulkit Gupta
3ccd5faabb
test_runner: format coverage report for tap reporter
...
PR-URL: https://github.com/nodejs/node/pull/51119
Reviewed-By: Raz Luvaton <rluvaton@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com >
2023-12-15 15:26:24 -03:00
Joyee Cheung
ed070755ec
test: deflake test-diagnostics-channel-memory-leak
...
PR-URL: https://github.com/nodejs/node/pull/50572
Refs: https://github.com/v8/v8/commit/0fd478bcdabd3400d9d74c47c4883c085ef37d18
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
2023-12-15 15:26:24 -03:00
Joyee Cheung
aee01ff1b4
test: test syncrhnous methods of child_process in snapshot
...
These currently work in snapshot builder scripts. Asynchronous
methods are not supported yet.
PR-URL: https://github.com/nodejs/node/pull/50943
Refs: https://github.com/nodejs/node/issues/50924
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2023-12-15 15:26:24 -03:00
Arsalan Ahmad
7f95926f17
http: handle multi-value content-disposition header
...
Headers in nodejs can be arrays and current workaround for
content-disposition header do not take this into account.
This change fixes that and makes sure array values are handled
properly.
PR-URL: https://github.com/nodejs/node/pull/50977
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2023-12-15 15:26:24 -03:00
Pulkit Gupta
d5c9adf3df
test_runner: fix infinite loop when files are undefined in test runner
...
PR-URL: https://github.com/nodejs/node/pull/51047
Fixes: https://github.com/nodejs/node/issues/48823
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: James M Snell <jasnell@gmail.com >
2023-12-15 15:26:23 -03:00
kylo5aby
5112306064
stream: fix fd is null when calling clearBuffer
...
PR-URL: https://github.com/nodejs/node/pull/50994
Fixes: https://github.com/nodejs/node/issues/50979
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Raz Luvaton <rluvaton@gmail.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
2023-12-15 15:26:23 -03:00
Joyee Cheung
c3abdc58af
src: implement --trace-promises
...
This patch implements a debugging flag that dumps the current
stack trace when a promise is created or resolved. To reduce
noise we ignore before and after events (as the execution is
less interesting) and use the per-isolate hook to avoid extra
JS frames. This flag can assist work in reducing unnecessary
promise overhead.
PR-URL: https://github.com/nodejs/node/pull/50899
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2023-12-15 15:26:22 -03:00
华
7a8a2d5632
lib: don't parse windows drive letters as schemes
...
We were incorrectly parsing windows drive letters as schemes. This was
polluting the source map cache with malformed file paths.
Fixes: https://github.com/nodejs/node/issues/50523
PR-URL: https://github.com/nodejs/node/pull/50580
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
2023-12-15 15:26:22 -03:00
Jérémy Lal and Antoine du Hamel
4ddd0daf5f
test: escape cwd in regexp
...
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/50980
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2023-12-15 15:26:21 -03:00
Yagiz Nizipli and Daniel Lemire
45e4f82912
src: move package resolver to c++
...
Co-authored-by: Daniel Lemire <daniel@lemire.me >
PR-URL: https://github.com/nodejs/node/pull/50322
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
2023-12-15 15:26:21 -03:00
Yagiz Nizipli
0dd53da722
deps: add simdjson
...
PR-URL: https://github.com/nodejs/node/pull/50322
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
2023-12-15 15:26:18 -03:00
Murilo Kakazu
724548674d
fs: use default w flag for writeFileSync with utf8 encoding
...
PR-URL: https://github.com/nodejs/node/pull/50990
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io >
2023-12-04 11:15:06 +01:00
Antoine du Hamel
32acafeeb6
fs: introduce dirent.parentPath
...
The goal is to replace `dirent.path` using a name that's less likely to
create confusion.
`dirent.path` value has not been stable, moving it to a different
property name should avoid breaking some upgrading user expectations.
PR-URL: https://github.com/nodejs/node/pull/50976
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev >
Reviewed-By: LiviaMedeiros <livia@cirno.name >
2023-12-04 11:15:05 +01:00
Angelo Parziale
3a1c664a97
test: replace forEach to for.. test-webcrypto-export-import-cfrg.js
...
PR-URL: https://github.com/nodejs/node/pull/50785
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
2023-12-04 11:15:05 +01:00
DylanTet
6a087ceffa
url: throw error if argument length of revokeObjectURL is 0
...
Added a check to see if url wasn't included as an argument
which will then throw an error.
Fixes: https://github.com/nodejs/node/issues/50432
PR-URL: https://github.com/nodejs/node/pull/50433
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com >
2023-12-04 11:15:04 +01:00
Joyee Cheung
94462d42f5
test: consolidate utf8 text fixtures in tests
...
We previously used a text that appears to be an excerpt of
https://zh.wikipedia.org/wiki/%E5%8D%97%E8%B6%8A%E5%9B%BD
and can have copyright/license complications. It may
also include some geopolitical nuances. The text has been
repeated through out the code base without much reuse.
This patch consolidates the fixtures by adding a common helper
string as `fixtures.utf8TestText` which is identical to a copy
in test/fixtures/utf8_test_text.txt. It also updates the text
to a copy of 蘭亭集序, It was chosen because:
1. It's a well-known Chinese classical piece written in 353 CE
and therefore in public domain. The string is copied from
https://zh.wikisource.org/zh-hant/%E8%98%AD%E4%BA%AD%E9%9B%86%E5%BA%8F
which contains a disclaimer of copyright for this reason.
2. The text is in suitable length for general UTF8 string
read/write tests (including punctuations, 389 code points and
1167 bytes).
3. This is also commonly used as reference text for Chinese text
layout tests.
4. It's a timeless and harmless preface for a collection of poems,
written by a uncontroversial figure who passed away >1600 years
ago and contains no geopolitical nuances. Background and an
English translation of this text can be found at
https://en.wikipedia.org/wiki/Lantingji_Xu
PR-URL: https://github.com/nodejs/node/pull/50732
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io >
2023-12-04 11:15:01 +01:00