Skip to content

Commit f76b323

Browse files
authored
Merge branch 'nodejs:main' into alsh/node_embedding_api
2 parents acf16cd + a822a1c commit f76b323

File tree

215 files changed

+5915
-5058
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

215 files changed

+5915
-5058
lines changed

.github/codeql-config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ name: CodeQL config
33
paths-ignore:
44
- test
55
- deps/v8/test
6+
- deps/v8/tools

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
Select a Node.js version below to view the changelog history:
44

5+
* [Node.js 24](doc/changelogs/CHANGELOG_V24.md) **Current**
56
* [Node.js 23](doc/changelogs/CHANGELOG_V23.md) **Current**
67
* [Node.js 22](doc/changelogs/CHANGELOG_V22.md) **Long Term Support**
78
* [Node.js 21](doc/changelogs/CHANGELOG_V21.md) End-of-Life
@@ -32,12 +33,17 @@ release.
3233

3334
<table>
3435
<tr>
36+
<th title="Current"><a href="doc/changelogs/CHANGELOG_V24.md">24</a> (Current)</th>
3537
<th title="Current"><a href="doc/changelogs/CHANGELOG_V23.md">23</a> (Current)</th>
3638
<th title="LTS Until 2027-04"><a href="doc/changelogs/CHANGELOG_V22.md">22</a> (LTS)</th>
3739
<th title="LTS Until 2026-04"><a href="doc/changelogs/CHANGELOG_V20.md">20</a> (LTS)</th>
3840
</tr>
3941
<tr>
4042
<td valign="top">
43+
<b><a href="doc/changelogs/CHANGELOG_V24.md#24.0.1">24.0.1</a></b><br/>
44+
<a href="doc/changelogs/CHANGELOG_V24.md#24.0.0">24.0.0</a><br/>
45+
</td>
46+
<td valign="top">
4147
<b><a href="doc/changelogs/CHANGELOG_V23.md#23.11.0">23.11.0</a></b><br/>
4248
<a href="doc/changelogs/CHANGELOG_V23.md#23.10.0">23.10.0</a><br/>
4349
<a href="doc/changelogs/CHANGELOG_V23.md#23.9.0">23.9.0</a><br/>

Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -509,16 +509,24 @@ SQLITE_BINDING_SOURCES := \
509509
$(wildcard test/sqlite/*/*.c)
510510

511511
# Implicitly depends on $(NODE_EXE), see the build-sqlite-tests rule for rationale.
512+
ifndef NOSQLITE
512513
test/sqlite/.buildstamp: $(ADDONS_PREREQS) \
513514
$(SQLITE_BINDING_GYPS) $(SQLITE_BINDING_SOURCES)
514515
@$(call run_build_addons,"$$PWD/test/sqlite",$@)
516+
else
517+
test/sqlite/.buildstamp:
518+
endif
515519

516520
.PHONY: build-sqlite-tests
521+
ifndef NOSQLITE
517522
# .buildstamp needs $(NODE_EXE) but cannot depend on it
518523
# directly because it calls make recursively. The parent make cannot know
519524
# if the subprocess touched anything so it pessimistically assumes that
520525
# .buildstamp is out of date and need a rebuild.
521526
build-sqlite-tests: | $(NODE_EXE) test/sqlite/.buildstamp ## Build SQLite tests.
527+
else
528+
build-sqlite-tests:
529+
endif
522530

523531
.PHONY: clear-stalled
524532
clear-stalled: ## Clear any stalled processes.

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,8 @@ maintaining the Node.js project.
755755
**Gireesh Punathil** <<[email protected]>> (he/him)
756756
* [gurgunday](https://github.com/gurgunday) -
757757
**Gürgün Dayıoğlu** <<[email protected]>>
758+
* [HBSPS](https://github.com/HBSPS) -
759+
**Wiyeong Seo** <<[email protected]>>
758760
* [iam-frankqiu](https://github.com/iam-frankqiu) -
759761
**Frank Qiu** <<[email protected]>> (he/him)
760762
* [KevinEady](https://github.com/KevinEady) -

benchmark/es/error-stack.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const bench = common.createBenchmark(main, {
1010
'without-sourcemap',
1111
'sourcemap',
1212
'node-modules-without-sourcemap',
13-
'node-module-sourcemap'],
13+
'node-modules-sourcemap'],
1414
n: [1e5],
1515
});
1616

common.gypi

+4-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
# Reset this number to 0 on major V8 upgrades.
4040
# Increment by one for each non-official patch applied to deps/v8.
41-
'v8_embedder_string': '-node.10',
41+
'v8_embedder_string': '-node.16',
4242

4343
##### V8 defaults for Node.js #####
4444

@@ -276,6 +276,9 @@
276276
# Defines these mostly for node-gyp to pickup.
277277
'defines': [
278278
'_GLIBCXX_USE_CXX11_ABI=1',
279+
# This help forks when building Node.js on a 32-bit arch as
280+
# libuv is always compiled with _FILE_OFFSET_BITS=64
281+
'_FILE_OFFSET_BITS=64'
279282
],
280283

281284
# Forcibly disable -Werror. We support a wide range of compilers, it's

configure.py

+17-1
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,12 @@
864864
default=None,
865865
help='build without NODE_OPTIONS support')
866866

867+
parser.add_argument('--without-sqlite',
868+
action='store_true',
869+
dest='without_sqlite',
870+
default=None,
871+
help='build without SQLite (disables SQLite and Web Stoage API)')
872+
867873
parser.add_argument('--ninja',
868874
action='store_true',
869875
dest='use_ninja',
@@ -1816,6 +1822,16 @@ def without_ssl_error(option):
18161822

18171823
configure_library('openssl', o)
18181824

1825+
def configure_sqlite(o):
1826+
o['variables']['node_use_sqlite'] = b(not options.without_sqlite)
1827+
if options.without_sqlite:
1828+
def without_sqlite_error(option):
1829+
error(f'--without-sqlite is incompatible with {option}')
1830+
if options.shared_sqlite:
1831+
without_sqlite_error('--shared-sqlite')
1832+
return
1833+
1834+
configure_library('sqlite', o, pkgname='sqlite3')
18191835

18201836
def configure_static(o):
18211837
if options.fully_static or options.partly_static:
@@ -2259,7 +2275,7 @@ def make_bin_override():
22592275
configure_library('nghttp2', output, pkgname='libnghttp2')
22602276
configure_library('nghttp3', output, pkgname='libnghttp3')
22612277
configure_library('ngtcp2', output, pkgname='libngtcp2')
2262-
configure_library('sqlite', output, pkgname='sqlite3')
2278+
configure_sqlite(output);
22632279
configure_library('uvwasi', output, pkgname='libuvwasi')
22642280
configure_library('zstd', output, pkgname='libzstd')
22652281
configure_v8(output, configurations)

deps/amaro/dist/index.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deps/amaro/dist/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"강동윤 <[email protected]>"
55
],
66
"description": "wasm module for swc",
7-
"version": "1.11.21",
7+
"version": "1.11.24",
88
"license": "Apache-2.0",
99
"repository": {
1010
"type": "git",

deps/amaro/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "amaro",
3-
"version": "0.5.2",
3+
"version": "0.5.3",
44
"description": "Node.js TypeScript wrapper",
55
"license": "MIT",
66
"type": "commonjs",

deps/llhttp/CMakeLists.txt

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
cmake_minimum_required(VERSION 3.5.1)
1+
cmake_minimum_required(VERSION 3.25.0)
22
cmake_policy(SET CMP0069 NEW)
33

4-
project(llhttp VERSION 9.2.1)
4+
project(llhttp VERSION 9.3.0)
55
include(GNUInstallDirs)
66

77
set(CMAKE_C_STANDARD 99)
@@ -49,7 +49,7 @@ function(config_library target)
4949

5050
target_include_directories(${target} PUBLIC
5151
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
52-
$<INSTALL_INTERFACE:include>
52+
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
5353
)
5454

5555
set_target_properties(${target} PROPERTIES
@@ -61,6 +61,7 @@ function(config_library target)
6161

6262
install(TARGETS ${target}
6363
EXPORT llhttp
64+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
6465
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
6566
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
6667
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}

deps/llhttp/LICENSE

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
This software is licensed under the MIT License.
2+
3+
Copyright Fedor Indutny, 2018.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a
6+
copy of this software and associated documentation files (the
7+
"Software"), to deal in the Software without restriction, including
8+
without limitation the rights to use, copy, modify, merge, publish,
9+
distribute, sublicense, and/or sell copies of the Software, and to permit
10+
persons to whom the Software is furnished to do so, subject to the
11+
following conditions:
12+
13+
The above copyright notice and this permission notice shall be included
14+
in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
19+
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
20+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
22+
USE OR OTHER DEALINGS IN THE SOFTWARE.

deps/llhttp/README.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ int main() {
9494
if (err == HPE_OK) {
9595
fprintf(stdout, "Successfully parsed!\n");
9696
} else {
97-
fprintf(stderr, "Parse error: %s %s\n", llhttp_errno_name(err), parser.reason);
97+
fprintf(stderr, "Parse error: %s %s\n", llhttp_errno_name(err), llhttp_get_error_reason(&parser));
9898
}
9999
}
100100
```
@@ -112,6 +112,7 @@ The following callbacks can return `0` (proceed normally), `-1` (error) or `HPE_
112112
* `on_message_complete`: Invoked when a request/response has been completedly parsed.
113113
* `on_url_complete`: Invoked after the URL has been parsed.
114114
* `on_method_complete`: Invoked after the HTTP method has been parsed.
115+
* `on_protocol_complete`: Invoked after the HTTP version has been parsed.
115116
* `on_version_complete`: Invoked after the HTTP version has been parsed.
116117
* `on_status_complete`: Invoked after the status code has been parsed.
117118
* `on_header_field_complete`: Invoked after a header name has been parsed.
@@ -130,6 +131,7 @@ The following callbacks can return `0` (proceed normally), `-1` (error) or `HPE_
130131
* `on_method`: Invoked when another character of the method is received.
131132
When parser is created with `HTTP_BOTH` and the input is a response, this also invoked for the sequence `HTTP/`
132133
of the first message.
134+
* `on_protocol`: Invoked when another character of the protocol is received.
133135
* `on_version`: Invoked when another character of the version is received.
134136
* `on_header_field`: Invoked when another character of a header name is received.
135137
* `on_header_value`: Invoked when another character of a header value is received.
@@ -187,7 +189,8 @@ Parse full or partial request/response, invoking user callbacks along the way.
187189
188190
If any of `llhttp_data_cb` returns errno not equal to `HPE_OK` - the parsing interrupts,
189191
and such errno is returned from `llhttp_execute()`. If `HPE_PAUSED` was used as a errno,
190-
the execution can be resumed with `llhttp_resume()` call.
192+
the execution can be resumed with `llhttp_resume()` call. In that case the input should be advanced
193+
to the last processed byte from the parser, which can be obtained via `llhttp_get_error_pos()`.
191194
192195
In a special case of CONNECT/Upgrade request/response `HPE_PAUSED_UPGRADE` is returned
193196
after fully parsing the request/response. If the user wishes to continue parsing,
@@ -196,6 +199,8 @@ they need to invoke `llhttp_resume_after_upgrade()`.
196199
**if this function ever returns a non-pause type error, it will continue to return
197200
the same error upon each successive call up until `llhttp_init()` is called.**
198201
202+
If this function returns `HPE_OK`, it means all the input has been consumed and parsed.
203+
199204
### `llhttp_errno_t llhttp_finish(llhttp_t* parser)`
200205
201206
This method should be called when the other side has no further bytes to

deps/llhttp/include/llhttp.h

+7-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#define INCLUDE_LLHTTP_H_
44

55
#define LLHTTP_VERSION_MAJOR 9
6-
#define LLHTTP_VERSION_MINOR 2
7-
#define LLHTTP_VERSION_PATCH 1
6+
#define LLHTTP_VERSION_MINOR 3
7+
#define LLHTTP_VERSION_PATCH 0
88

99
#ifndef INCLUDE_LLHTTP_ITSELF_H_
1010
#define INCLUDE_LLHTTP_ITSELF_H_
@@ -90,7 +90,8 @@ enum llhttp_errno {
9090
HPE_CB_HEADER_VALUE_COMPLETE = 29,
9191
HPE_CB_CHUNK_EXTENSION_NAME_COMPLETE = 34,
9292
HPE_CB_CHUNK_EXTENSION_VALUE_COMPLETE = 35,
93-
HPE_CB_RESET = 31
93+
HPE_CB_RESET = 31,
94+
HPE_CB_PROTOCOL_COMPLETE = 38
9495
};
9596
typedef enum llhttp_errno llhttp_errno_t;
9697

@@ -326,6 +327,7 @@ typedef enum llhttp_status llhttp_status_t;
326327
XX(34, CB_CHUNK_EXTENSION_NAME_COMPLETE, CB_CHUNK_EXTENSION_NAME_COMPLETE) \
327328
XX(35, CB_CHUNK_EXTENSION_VALUE_COMPLETE, CB_CHUNK_EXTENSION_VALUE_COMPLETE) \
328329
XX(31, CB_RESET, CB_RESET) \
330+
XX(38, CB_PROTOCOL_COMPLETE, CB_PROTOCOL_COMPLETE) \
329331

330332

331333
#define HTTP_METHOD_MAP(XX) \
@@ -567,6 +569,7 @@ struct llhttp_settings_s {
567569
llhttp_cb on_message_begin;
568570

569571
/* Possible return values 0, -1, HPE_USER */
572+
llhttp_data_cb on_protocol;
570573
llhttp_data_cb on_url;
571574
llhttp_data_cb on_status;
572575
llhttp_data_cb on_method;
@@ -592,6 +595,7 @@ struct llhttp_settings_s {
592595

593596
/* Possible return values 0, -1, `HPE_PAUSED` */
594597
llhttp_cb on_message_complete;
598+
llhttp_cb on_protocol_complete;
595599
llhttp_cb on_url_complete;
596600
llhttp_cb on_status_complete;
597601
llhttp_cb on_method_complete;

deps/llhttp/libllhttp.pc.in

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
prefix=@CMAKE_INSTALL_PREFIX@
2-
exec_prefix=@CMAKE_INSTALL_PREFIX@
3-
libdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@
4-
includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@
2+
exec_prefix=@CMAKE_INSTALL_FULL_BINDIR@
3+
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
4+
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
55

66
Name: libllhttp
77
Description: Node.js llhttp Library
88
Version: @PROJECT_VERSION@
99
Libs: -L${libdir} -lllhttp
10-
Cflags: -I${includedir}
10+
Cflags: -I${includedir}

deps/llhttp/src/api.c

+22-23
Original file line numberDiff line numberDiff line change
@@ -57,29 +57,14 @@ static int wasm_on_headers_complete_wrap(llhttp_t* p) {
5757
}
5858

5959
const llhttp_settings_t wasm_settings = {
60-
wasm_on_message_begin,
61-
wasm_on_url,
62-
wasm_on_status,
63-
NULL,
64-
NULL,
65-
wasm_on_header_field,
66-
wasm_on_header_value,
67-
NULL,
68-
NULL,
69-
wasm_on_headers_complete_wrap,
70-
wasm_on_body,
71-
wasm_on_message_complete,
72-
NULL,
73-
NULL,
74-
NULL,
75-
NULL,
76-
NULL,
77-
NULL,
78-
NULL,
79-
NULL,
80-
NULL,
81-
NULL,
82-
NULL,
60+
.on_message_begin = wasm_on_message_begin,
61+
.on_url = wasm_on_url,
62+
.on_status = wasm_on_status,
63+
.on_header_field = wasm_on_header_field,
64+
.on_header_value = wasm_on_header_value,
65+
.on_headers_complete = wasm_on_headers_complete_wrap,
66+
.on_body = wasm_on_body,
67+
.on_message_complete = wasm_on_message_complete,
8368
};
8469

8570

@@ -341,6 +326,20 @@ int llhttp__on_message_begin(llhttp_t* s, const char* p, const char* endp) {
341326
}
342327

343328

329+
int llhttp__on_protocol(llhttp_t* s, const char* p, const char* endp) {
330+
int err;
331+
SPAN_CALLBACK_MAYBE(s, on_protocol, p, endp - p);
332+
return err;
333+
}
334+
335+
336+
int llhttp__on_protocol_complete(llhttp_t* s, const char* p, const char* endp) {
337+
int err;
338+
CALLBACK_MAYBE(s, on_protocol_complete);
339+
return err;
340+
}
341+
342+
344343
int llhttp__on_url(llhttp_t* s, const char* p, const char* endp) {
345344
int err;
346345
SPAN_CALLBACK_MAYBE(s, on_url, p, endp - p);

0 commit comments

Comments
 (0)