diff options
author | Michaël Zasso <targos@protonmail.com> | 2018-08-26 11:12:15 +0300 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2018-08-29 13:28:16 +0300 |
commit | 17dd620e58f32f2e44b12b139b76f6c3d7abae75 (patch) | |
tree | 6dc44dcff1a1481aa3cf7c88944a0021615c170b /deps | |
parent | a64fd7f320af90dd76b7d922f104e5715797f0a6 (diff) |
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: https://github.com/v8/v8/commit/3dd5c6fe38355b8323597341409b37f931de5a85
PR-URL: https://github.com/nodejs/node/pull/22531
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'deps')
-rw-r--r-- | deps/v8/include/v8.h | 4 | ||||
-rw-r--r-- | deps/v8/src/api.cc | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index 67c1e1065fe..249a4aa184d 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -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, diff --git a/deps/v8/src/api.cc b/deps/v8/src/api.cc index ffb68532066..65ab80ea7f4 100644 --- a/deps/v8/src/api.cc +++ b/deps/v8/src/api.cc @@ -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); |