Bug 1235874 - handle null filename in DescribeScriptedCaller (r=sunfish)

This commit is contained in:
Luke Wagner 2015-12-30 13:50:56 -06:00
parent 346ccd0aff
commit 7d8eec8034
2 changed files with 4 additions and 1 deletions

View File

@ -0,0 +1 @@
evaluate('evalcx("1")', { fileName: null });

View File

@ -5909,6 +5909,8 @@ JS_PUBLIC_API(bool)
DescribeScriptedCaller(JSContext* cx, UniqueChars* filename, unsigned* lineno,
unsigned* column)
{
if (filename)
filename->reset();
if (lineno)
*lineno = 0;
if (column)
@ -5923,7 +5925,7 @@ DescribeScriptedCaller(JSContext* cx, UniqueChars* filename, unsigned* lineno,
if (i.activation()->scriptedCallerIsHidden())
return false;
if (filename) {
if (filename && i.filename()) {
UniqueChars copy = make_string_copy(i.filename());
if (!copy)
return false;