Skip to content

Commit 5f44ce8

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: #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 8375f75 commit 5f44ce8

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
@@ -2580,7 +2580,9 @@ class V8_EXPORT String : public Name {
25802580
* Returns the number of bytes in the UTF-8 encoded
25812581
* representation of this string.
25822582
*/
2583-
int Utf8Length() const;
2583+
V8_DEPRECATE_SOON("Use Isolate version instead", int Utf8Length() const);
2584+
2585+
int Utf8Length(Isolate* isolate) const;
25842586

25852587
/**
25862588
* 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
@@ -5476,6 +5476,9 @@ bool String::ContainsOnlyOneByte() const {
54765476
return helper.Check(*str);
54775477
}
54785478

5479+
int String::Utf8Length(Isolate* isolate) const {
5480+
return Utf8Length();
5481+
}
54795482

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

0 commit comments

Comments
 (0)