Skip to content

Commit 3550038

Browse files
Merge branch 'nodejs:main' into main
2 parents 46e0893 + 5b8b921 commit 3550038

File tree

91 files changed

+791
-623
lines changed

Some content is hidden

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

91 files changed

+791
-623
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ For information about the governance of the Node.js project, see
444444
**Rich Trott** <<rtrott@gmail.com>> (he/him)
445445
* [vdeturckheim](https://github.com/vdeturckheim) -
446446
**Vladimir de Turckheim** <<vlad2t@hotmail.com>> (he/him)
447-
* [VoltrexMaster](https://github.com/VoltrexMaster) -
447+
* [VoltrexKeyva](https://github.com/VoltrexKeyva) -
448448
**Mohammed Keyvanzadeh** <<mohammadkeyvanzade94@gmail.com>> (he/him)
449449
* [watilde](https://github.com/watilde) -
450450
**Daijiro Wachi** <<daijiro.wachi@gmail.com>> (he/him)
@@ -690,7 +690,7 @@ maintaining the Node.js project.
690690
**Pooja Durgad** <<Pooja.D.P@ibm.com>>
691691
* [RaisinTen](https://github.com/RaisinTen) -
692692
**Darshan Sen** <<raisinten@gmail.com>>
693-
* [VoltrexMaster](https://github.com/VoltrexMaster) -
693+
* [VoltrexKeyva](https://github.com/VoltrexKeyva) -
694694
**Mohammed Keyvanzadeh** <<mohammadkeyvanzade94@gmail.com>> (he/him)
695695

696696
Triagers follow the [Triage Guide](./doc/contributing/issues.md#triaging-a-bug-report) when

common.gypi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# Reset this number to 0 on major V8 upgrades.
3838
# Increment by one for each non-official patch applied to deps/v8.
39-
'v8_embedder_string': '-node.19',
39+
'v8_embedder_string': '-node.20',
4040

4141
##### V8 defaults for Node.js #####
4242

deps/v8/AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Allan Sandfeld Jensen <allan.jensen@qt.io>
6060
Amos Lim <eui-sang.lim@samsung.com>
6161
Andreas Anyuru <andreas.anyuru@gmail.com>
6262
Andrei Kashcha <anvaka@gmail.com>
63+
Andreu Botella <andreu@andreubotella.com>
6364
Andrew Paprocki <andrew@ishiboo.com>
6465
Anna Henningsen <anna@addaleax.net>
6566
Antoine du Hamel <duhamelantoine1995@gmail.com>

deps/v8/include/v8-array-buffer.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,11 @@ class V8_EXPORT ArrayBuffer : public Object {
240240
*/
241241
bool IsDetachable() const;
242242

243+
/**
244+
* Returns true if this ArrayBuffer has been detached.
245+
*/
246+
bool WasDetached() const;
247+
243248
/**
244249
* Detaches this ArrayBuffer and all its views (typed arrays).
245250
* Detaching sets the byte length of the buffer and all typed arrays to zero,
@@ -253,6 +258,9 @@ class V8_EXPORT ArrayBuffer : public Object {
253258
* pointer coordinates the lifetime management of the internal storage
254259
* with any live ArrayBuffers on the heap, even across isolates. The embedder
255260
* should not attempt to manage lifetime of the storage through other means.
261+
*
262+
* The returned shared pointer will not be empty, even if the ArrayBuffer has
263+
* been detached. Use |WasDetached| to tell if it has been detached instead.
256264
*/
257265
std::shared_ptr<BackingStore> GetBackingStore();
258266

deps/v8/src/api/api.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8064,6 +8064,10 @@ bool v8::ArrayBuffer::IsDetachable() const {
80648064
return Utils::OpenHandle(this)->is_detachable();
80658065
}
80668066

8067+
bool v8::ArrayBuffer::WasDetached() const {
8068+
return Utils::OpenHandle(this)->was_detached();
8069+
}
8070+
80678071
namespace {
80688072
std::shared_ptr<i::BackingStore> ToInternal(
80698073
std::shared_ptr<i::BackingStoreBase> backing_store) {

deps/v8/test/cctest/cctest.status

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@
516516
'test-api/WasmI32AtomicWaitCallback': [SKIP],
517517
'test-api/WasmI64AtomicWaitCallback': [SKIP],
518518
'test-api/WasmSetJitCodeEventHandler': [SKIP],
519+
'test-api-array-buffer/ArrayBuffer_NonDetachableWasDetached': [SKIP],
519520
'test-backing-store/Run_WasmModule_Buffer_Externalized_Regression_UseAfterFree': [SKIP],
520521
'test-c-wasm-entry/*': [SKIP],
521522
'test-compilation-cache/*': [SKIP],

deps/v8/test/cctest/test-api-array-buffer.cc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,37 @@ THREADED_TEST(ArrayBuffer_DetachingScript) {
245245
CheckDataViewIsDetached(dv);
246246
}
247247

248+
THREADED_TEST(ArrayBuffer_WasDetached) {
249+
LocalContext env;
250+
v8::Isolate* isolate = env->GetIsolate();
251+
v8::HandleScope handle_scope(isolate);
252+
253+
Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(isolate, 0);
254+
CHECK(!ab->WasDetached());
255+
256+
ab->Detach();
257+
CHECK(ab->WasDetached());
258+
}
259+
260+
THREADED_TEST(ArrayBuffer_NonDetachableWasDetached) {
261+
LocalContext env;
262+
v8::Isolate* isolate = env->GetIsolate();
263+
v8::HandleScope handle_scope(isolate);
264+
265+
CompileRun(R"JS(
266+
var wasmMemory = new WebAssembly.Memory({initial: 1, maximum: 2});
267+
)JS");
268+
269+
Local<v8::ArrayBuffer> non_detachable =
270+
CompileRun("wasmMemory.buffer").As<v8::ArrayBuffer>();
271+
CHECK(!non_detachable->IsDetachable());
272+
CHECK(!non_detachable->WasDetached());
273+
274+
CompileRun("wasmMemory.grow(1)");
275+
CHECK(!non_detachable->IsDetachable());
276+
CHECK(non_detachable->WasDetached());
277+
}
278+
248279
THREADED_TEST(ArrayBuffer_ExternalizeEmpty) {
249280
LocalContext env;
250281
v8::Isolate* isolate = env->GetIsolate();

doc/.eslintrc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ rules:
1515

1616
# Stylistic Issues
1717
no-multiple-empty-lines: [error, {max: 1, maxEOF: 0, maxBOF: 0}]
18+
comma-dangle: [error, always-multiline]

0 commit comments

Comments
 (0)