On Thu, May 4, 2017 at 10:08 AM, Henri Sivonen <hsivo...@hsivonen.fi> wrote:
> Is it feasible (with reasonably low effort) to introduce a new XPIDL
> type that is a pointer to a non-refcounted immutable static object in
> C++ and still gets bridged to JS?

My question was underspecified. At minimum, the JS bridging should
have these properties:
1) Returning a non-null const Encoding* from C++ materializes a JS object.
2) Passing the JS object back to C++ materializes the original pointer
on the C++ side.
3) Returning a null const Encoding* from C++ materializes a JS null.
4) Passing a JS null to C++ materializes nullptr.
5) Comparing two JS objects materialized per point #1 with == is true
iff they were materiazed from the same C++ pointer.

Is that kind of thing doable with little effort?

It would be a bonus if the JS objects could come with pre-defined
methods, but that's not strictly necessary.

-- 
Henri Sivonen
hsivo...@hsivonen.fi
https://hsivonen.fi/
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to