servo / rust-mozjs

DEPRECATED - moved to servo/mozjs instead.
Mozilla Public License 2.0
293 stars 122 forks source link

Implement a wrapper around DescribeScriptedCaller #507

Closed jdm closed 4 years ago

jdm commented 4 years ago

https://searchfox.org/mozilla-central/rev/158bac3df3a1890da55bdb6ffdaf9a7ffc0bfb0a/js/src/jsapi.h#2783-2804

This API takes a JS::AutoFilename argument, and implementing a Rust wrapper around just that type would require duplicating C++ logic in https://searchfox.org/mozilla-central/rev/158bac3df3a1890da55bdb6ffdaf9a7ffc0bfb0a/js/src/jsapi.cpp#5512-5549 which is a waste. Much better to write a small C++ stub that copies the filename string out into a buffer that Rust provides instead.