From e7f7100ba6759f30295dbc49f819ebb9c4785298 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Wed, 1 Aug 2018 08:58:59 +0200 Subject: Bug 1335296 - Expand about:support WebGL information --- dom/canvas/WebGLContextUtils.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'dom/canvas/WebGLContextUtils.cpp') diff --git a/dom/canvas/WebGLContextUtils.cpp b/dom/canvas/WebGLContextUtils.cpp index 9c0d34939..3fd32eb30 100644 --- a/dom/canvas/WebGLContextUtils.cpp +++ b/dom/canvas/WebGLContextUtils.cpp @@ -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 -- cgit v1.2.3