Could you post that as a patch?
> Could you post that as a patch? I am sorry, but I don't know what you mean by this. The supplied code is a replacement for the function js_GetScriptLineExtent in jsscript.cpp. The changes are quite short and simple. Here is a diff: 1924a1925,1926 > > bool counting; 1925a1928 > uintN maxLineNo; 1929a1933,1934 > maxLineNo = 0; > counting = true; 1932a1938,1939 > if (maxLineNo < lineno) > maxLineNo = lineno; 1933a1941,1945 > counting = true; > if (maxLineNo < lineno) > maxLineNo = lineno; > else > counting = false; 1935c1947,1948 < lineno++; --- > if (counting) > lineno++; 1937a1951,1954 > > if (maxLineNo > lineno) > lineno = maxLineNo; >
(In reply to comment #2) > > Could you post that as a patch? > > I am sorry, but I don't know what you mean by this. I mean a diff in the 'unified' format with 8 lines of context. That's the standard form we use to review and take changes. I guess you are using a source release rather than hg, so the output of 'diff -u 8' should work.
I have added an attachment with a diff -u 8 of the changes.
Comment on attachment 545439 [details] [diff] [review] diff -u 8 of changes Looks good to me, other than an extra newline at the top. It's funny, I was just looking at that code a few days ago and thinking, "Really? That works? We must *really* constrain our bytecode generation in funky ways!" I actually pushed this to try an hour ago. If it's green, I'll land it along with some other patches.
http://hg.mozilla.org/integration/mozilla-inbound/rev/d1746a8b20a9 That's your patch plus I wrapped up your test code into jsapi-test/testScriptInfo.cpp that tests this plus a few other related APIs.