Bug 1335296 - Expand about:support WebGL information

This commit is contained in:
janekptacijarabaci 2018-08-01 08:58:59 +02:00 • committed by Roy Tam
commit 43c36e207f
25 changed files with 256 additions and 29 deletions

View file

@ -874,4 +874,16 @@ InfoFrom(WebGLTexImageFunc func, WebGLTexDimensions dims)
}
}
JS::Value
StringValue(JSContext* cx, const nsAString& str, ErrorResult& er)
{
JSString* jsStr = JS_NewUCStringCopyN(cx, str.BeginReading(), str.Length());
if (!jsStr) {
er.Throw(NS_ERROR_OUT_OF_MEMORY);
return JS::NullValue();
}
return JS::StringValue(jsStr);
}
} // namespace mozilla