Re this bug and the other one I discussed, please find attached a
patch which fixes it.
This also adds three new methods to the JavaScript::SpiderMonkey
object, which are "eval_file", "compile_file" and "decompile". The
"eval_file" method is as discussed on the other bug report. The
"compile_file" method might be useful for someone who wants to do a
syntax check of their JavaScript. The "compile" plus "decompile" can
be used, e.g. to make an indenter. There are some new test scripts
which test some of the functions but the documentation is not
complete.
Some notes: the "name" and "indent" arguments to JS_DecompileScript
I've included for completeness, but "name" doesn't seem to do
anything, and "indent" just indents everything by a fixed amount, with
the actual indentation of braces etc. used being four spaces
regardless of what this is set to. Also, I've used the return value
from the function "as is", but it seems to me that it should be copied
into a new string, since otherwise it seems to be a memory leak
somewhere, and maybe the JavaScript interpreter will garbage collect
it?
I'll hold off writing full documentation for the new functions pending
approval of them. Please let me know what you think of these new
things.
Message body not shown because it is not plain text.