diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
commit | 59203c63bb777a3bacec32fb8830fba33540e809 (patch) | |
tree | 58298e711c0ff0575818c30485b44a2f21bf28a0 /js/xpconnect/src/XPCString.cpp | |
parent | Adding upstream version 126.0.1. (diff) | |
download | firefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip |
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/xpconnect/src/XPCString.cpp')
-rw-r--r-- | js/xpconnect/src/XPCString.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/js/xpconnect/src/XPCString.cpp b/js/xpconnect/src/XPCString.cpp index 5d784a02fd..651f3dde9f 100644 --- a/js/xpconnect/src/XPCString.cpp +++ b/js/xpconnect/src/XPCString.cpp @@ -104,8 +104,7 @@ bool XPCStringConvert::ReadableToJSVal(JSContext* cx, const nsAString& readable, return StringLiteralToJSVal(cx, readable.BeginReading(), length, vp); } - nsStringBuffer* buf = nsStringBuffer::FromString(readable); - if (buf) { + if (nsStringBuffer* buf = readable.GetStringBuffer()) { bool shared; if (!UCStringBufferToJSVal(cx, buf, length, vp, &shared)) { return false; @@ -138,8 +137,7 @@ bool XPCStringConvert::Latin1ToJSVal(JSContext* cx, const nsACString& latin1, length, vp); } - nsStringBuffer* buf = nsStringBuffer::FromString(latin1); - if (buf) { + if (nsStringBuffer* buf = latin1.GetStringBuffer()) { bool shared; if (!Latin1StringBufferToJSVal(cx, buf, length, vp, &shared)) { return false; @@ -170,8 +168,7 @@ bool XPCStringConvert::UTF8ToJSVal(JSContext* cx, const nsACString& utf8, cx, JS::UTF8Chars(utf8.BeginReading(), length), vp); } - nsStringBuffer* buf = nsStringBuffer::FromString(utf8); - if (buf) { + if (nsStringBuffer* buf = utf8.GetStringBuffer()) { bool shared; if (!UTF8StringBufferToJSVal(cx, buf, length, vp, &shared)) { return false; |