mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-25 18:07:31 +09:00
Add ConvertJSValueTo*String functions that just take a value and hand out a string, without extra complications
This commit is contained in:
parent
6196fdda47
commit
e234612456
3 changed files with 34 additions and 8 deletions
|
|
@ -2127,11 +2127,30 @@ ConvertJSValueToString(JSContext* cx, JS::Handle<JS::Value> v,
|
|||
return AssignJSString(cx, result, s);
|
||||
}
|
||||
|
||||
void
|
||||
NormalizeUSVString(JSContext* aCx, nsAString& aString);
|
||||
template<typename T>
|
||||
static inline bool
|
||||
ConvertJSValueToString(JSContext* cx, JS::Handle<JS::Value> v, T& result)
|
||||
{
|
||||
return ConvertJSValueToString(cx, v, eStringify, eStringify, result);
|
||||
}
|
||||
|
||||
void
|
||||
NormalizeUSVString(JSContext* aCx, binding_detail::FakeString& aString);
|
||||
NormalizeUSVString(nsAString& aString);
|
||||
|
||||
void
|
||||
NormalizeUSVString(binding_detail::FakeString& aString);
|
||||
|
||||
template<typename T>
|
||||
static inline bool
|
||||
ConvertJSValueToUSVString(JSContext* cx, JS::Handle<JS::Value> v, T& result)
|
||||
{
|
||||
if (!ConvertJSValueToString(cx, v, eStringify, eStringify, result)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
NormalizeUSVString(result);
|
||||
return true;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline bool
|
||||
|
|
@ -2158,6 +2177,13 @@ bool
|
|||
ConvertJSValueToByteString(JSContext* cx, JS::Handle<JS::Value> v,
|
||||
bool nullable, nsACString& result);
|
||||
|
||||
inline bool
|
||||
ConvertJSValueToByteString(JSContext* cx, JS::Handle<JS::Value> v,
|
||||
nsACString& result)
|
||||
{
|
||||
return ConvertJSValueToByteString(cx, v, false, result);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void DoTraceSequence(JSTracer* trc, FallibleTArray<T>& seq);
|
||||
template<typename T>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue