On 1/23/15 10:33 AM, Tomasz wrote:
cgThings.append(CGGeneric(' if (JS::CaptureCurrentStack(cx,
&stack, 1)) { \n'))
cgThings.append(CGGeneric(' JS::Rooted<JS::Value> source(cx);
\n'))
Also, this is very very wrong. If JS::CaptureCurrentStack returns
false, you must immediately return false from this function. Same if
JS_GetProperty returns false or if nsAutoJSString::init returns false.
I very carefully wrote it with early returns; I'm not sure why you
converted to nested conditionals.
In the nested-conditional case, you will continue to do things after
this code even if there's already an exception thrown (which is what the
false returns mean), which will make the code after this block blow up
spectacularly and randomly. Please do use the early returns. ;)
-Boris
_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform