jsStrdup function
Implementation
String jsStrdup(JSContext ctx, String str) {
final ret = js_strdup(ctx.ref, str.toNativeUtf8());
return String.fromCharCodes(
Uint16List.view(
ret.cast<Uint16>().asTypedList(str.length).buffer,
0,
str.length,
),
);
}