| 195 | } |
| 196 | |
| 197 | bool gjs_string_from_utf8_n(JSContext* cx, const char* utf8_chars, size_t len, |
| 198 | JS::MutableHandleValue out) { |
| 199 | JS::UTF8Chars chars(utf8_chars, len); |
| 200 | JS::RootedString str(cx, JS_NewStringCopyUTF8N(cx, chars)); |
| 201 | if (str) |
| 202 | out.setString(str); |
| 203 | |
| 204 | return !!str; |
| 205 | } |
| 206 | |
| 207 | bool gjs_string_to_filename(JSContext* cx, const JS::Value filename_val, |
| 208 | Gjs::AutoChar* filename_string) { |
no outgoing calls