On May 13, 3:58 pm, [EMAIL PROTECTED] wrote:
> Hi Everyone,
>
> with the following source code:
>
> function myFunc(a, b, c) {
>   let sum = a + b + c ;
>   return sum / 3 ;
>
> }
>
> p("the string is: " + myFunc.toString()) ;
>
> I get the following output:
>
> the string is:
> function myFunc(a, b, c) {
>     let sum = a + b + creturn sum / 3;
>
> }
>
> Applying the following patch:
>
> diff -r -u mozilla/js/rhino/src/org/mozilla/javascript/Parser.java
> mozilla-patched/js/rhino/src/org/mozilla/javascript/Parser.java
> --- mozilla/js/rhino/src/org/mozilla/javascript/Parser.java     2008-04-19
> 18:53:24.000000000 -0700
> +++ mozilla-patched/js/rhino/src/org/mozilla/javascript/Parser.java
> 2008-05-13 12:46:51.000000000 -0700
> @@ -1117,7 +1117,7 @@
>              } else {
>                  pn = variables(false, tt);
>              }
> -            return pn;
> +            break;
>            }
>
>            case Token.RETURN:
>
> gives the following (presumably correct) output:
>
> the string is:
> function myFunc(a, b, c) {
>     let sum = a + b + c;
>     return sum / 3;
>
> }
>
> Let me know if anyone sees a problem with this!
>
> Thanks,
> Ben

Thanks. I created bug https://bugzilla.mozilla.org/show_bug.cgi?id=433878
and fixed it.

Once I ran this through the regression tests, this ended up being more
complicated than your patch unfortunately. There was a missing error
check all along, but the previous bug caused us to pass a negative
test, so I had to implement an additional error check to get
everything to pass.

--N
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to