Re: error: incomplete type ‘JSLinearString’ used in nested name specifier
Kram Jordy <[email protected]> Sat, 30 May 2020 14:42:22 -0700 (PDT)
| Newsgroups | gmane.comp.mozilla.devel.jseng |
|---|---|
| Message-ID | <[email protected]> |
Thanks for your insights Steve, I've filed a bug report as suggested, #1642154.
I was following the examples in the js-shell, however, they do the same thing about 4 different ways, so I was rather confused!
JSString* str = argv[0].toString();
JSLinearString* linearStr = JS_EnsureLinearString(cx, str);
if (!linearStr) {
return false;
}
----
RootedLinearString linearFormat(
cx, optionFormat.toString()->ensureLinear(cx));
if (!linearFormat) {
return false;
}
----
Rooted<JSLinearString*> linear(cx, str->ensureLinear(cx));
if (!linear) {
return false;
}
----
if (!JSString::ensureLinear(cx, v.toString())) {
return false;
}
RootedLinearString input(cx, &v.toString()->asLinear());