Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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
  • Loading branch information
targos committed Aug 29, 2018
commit 761c0a0fa5c72a9161ef57d59c1d5642caac5b10
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

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

# Enable disassembler for `--print-code` v8 options
'v8_enable_disassembler': 1,
Expand Down
4 changes: 3 additions & 1 deletion deps/v8/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -2674,7 +2674,9 @@ class V8_EXPORT String : public Name {
* Returns the number of bytes in the UTF-8 encoded
* representation of this string.
*/
int Utf8Length() const;
V8_DEPRECATE_SOON("Use Isolate version instead", int Utf8Length() const);

int Utf8Length(Isolate* isolate) const;

/**
* Returns whether this string is known to contain only one byte data,
Expand Down
3 changes: 3 additions & 0 deletions deps/v8/src/api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5484,6 +5484,9 @@ bool String::ContainsOnlyOneByte() const {
return helper.Check(*str);
}

int String::Utf8Length(Isolate* isolate) const {
return Utf8Length();
}

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