Well, the latest version of OS.File privately reimplements a non-negligible subset of js-ctypes just for the purpose of passing arguments from JS to C++. This is rather wasteful, but I do not see any way to escape this unless such code is built into js-ctypes – short of rewriting all the serialization code for every function, which multiplies code size by about 10.
(In reply to David Rajchenbach Teller [:Yoric] from comment #2) > Well, the latest version of OS.File privately reimplements a non-negligible > subset of js-ctypes just for the purpose of passing arguments from JS to > C++. This is rather wasteful, but I do not see any way to escape this unless > such code is built into js-ctypes – short of rewriting all the serialization > code for every function, which multiplies code size by about 10. Are you talking about ImplicitConvert and friends? We could probably expose that stuff somehow via jsfriendapi...
Seems like if there are bits of ctypes that would be useful for you, writing raw JSAPI, then we should just make those reusable, no?
Ok, after input from Taras, I have basically reimplemented os.file purely on js-ctypes and extended js-ctypes to permit finalization (see bug 720771). So I do not require the feature covered by this bug anymore. I am closing that bug. If someone wants to reopen it, feel free to.