Skip to content

Commit 17dd620

Browse files
committed
deps: backport String::Utf8Length with isolate
This overload was added in V8 6.9 and the one without the isolate parameter was removed in V8 7.0. Refs: v8/v8@3dd5c6f PR-URL: nodejs#22531 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent a64fd7f commit 17dd620

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
# Reset this number to 0 on major V8 upgrades.
3131
# Increment by one for each non-official patch applied to deps/v8.
32-
'v8_embedder_string': '-node.21',
32+
'v8_embedder_string': '-node.22',
3333

3434
# Enable disassembler for `--print-code` v8 options
3535
'v8_enable_disassembler': 1,

deps/v8/include/v8.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -2674,7 +2674,9 @@ class V8_EXPORT String : public Name {
26742674
* Returns the number of bytes in the UTF-8 encoded
26752675
* representation of this string.
26762676
*/
2677-
int Utf8Length() const;
2677+
V8_DEPRECATE_SOON("Use Isolate version instead", int Utf8Length() const);
2678+
2679+
int Utf8Length(Isolate* isolate) const;
26782680

26792681
/**
26802682
* Returns whether this string is known to contain only one byte data,

deps/v8/src/api.cc

+3
Original file line numberDiff line numberDiff line change
@@ -5484,6 +5484,9 @@ bool String::ContainsOnlyOneByte() const {
54845484
return helper.Check(*str);
54855485
}
54865486

5487+
int String::Utf8Length(Isolate* isolate) const {
5488+
return Utf8Length();
5489+
}
54875490

54885491
int String::Utf8Length() const {
54895492
i::Handle<i::String> str = Utils::OpenHandle(this);

0 commit comments

Comments
 (0)