Re: [JS-internals] OOM exceptions

2016-05-09 Thread Nicholas Nethercote
On Tue, May 10, 2016 at 9:50 AM, Nick Fitzgerald wrote: > Or, if we don't want to boil too many oceans and have something closer to > our usage of bool and not worry about wrapping types: > > class Result > { > public: > enum class Type : uint32_t > { > Ok, > Oom, >

Re: [JS-internals] OOM exceptions

2016-05-09 Thread Steve Fink
On 05/09/2016 04:32 PM, Nicholas Nethercote wrote: On Sat, Apr 23, 2016 at 9:29 AM, Nicholas Nethercote wrote: one thing I've been thinking about is using MOZ_WARN_UNUSED_RESULT more. It isn't useful for the "return null on failure" case, because the result will always be used even if you forge

Re: [JS-internals] OOM exceptions

2016-05-09 Thread Nick Fitzgerald
If we are going to leave bool behind, I think we should use something Rustic: template class MOZ_MUST_USE_TYPE Result : public mozilla::Variant { public: // Helper methods here... explicit operator bool () { return is(); } // Etc... }; Or, if we don't want to boil too many ocean

Re: [JS-internals] OOM exceptions

2016-05-09 Thread Nicholas Nethercote
On Sat, Apr 23, 2016 at 9:29 AM, Nicholas Nethercote wrote: > > one thing I've been thinking about is using > MOZ_WARN_UNUSED_RESULT more. > It isn't useful for the "return null on failure" case, because the > result will always be used even if you forget the check. But it is > useful for the "ret

Re: [JS-internals] Rust JSAPI bindings in js/src?

2016-05-09 Thread Jack Moffitt
> What *should* happen if we add a parameter to a JSAPI function? Should we > add it to the rust-mozjs equivalent at the same time, immediately breaking > downstream users? Generally you'd make a corresponding change to the Rust bindings immediately and we'd have unit tests for them that ensured t

Re: [JS-internals] Rust JSAPI bindings in js/src?

2016-05-09 Thread Jason Orendorff
On Mon, May 9, 2016 at 3:41 PM, Jim Blandy wrote: > Hi, folks. How does the SpiderMonkey team feel about moving the Servo > project's Rust JSAPI bindings from the separate github repo > they're in now into js/src in > Mozilla > Central? > We talked about thi

[JS-internals] Rust JSAPI bindings in js/src?

2016-05-09 Thread Jim Blandy
Hi, folks. How does the SpiderMonkey team feel about moving the Servo project's Rust JSAPI bindings from the separate github repo they're in now into js/src in Mozilla Central? Two weeks ago I posted a message, "Rust bindings for Debugger API", pointing folks