On Aug 25, 11:47 pm, Norris Boyd <[EMAIL PROTECTED]> wrote:
>
> The way you're using Rhino is fine; the VerifyError is a bug. Can you
> create a bug report (https://bugzilla.mozilla.org/enter_bug.cgi?
> product=Rhino) and attach .js file you quote above as the line
> wrapping has made it unparseable as is?
>
> It may be possible to work around the problem by moving some of the
> innermost try-catch blocks to a new function.
>
> Thanks,
> Norris- Hide quoted text -
>
> - Show quoted text -

Thanks for your reply.  I've created Bugzilla issue 452148 for this.

We have a large amount of our file reformatting code in JavaScript
(over 400 script files, each approximately 40k in size).  It's not
practical for me to edit the offending scripts to work around this.
However, I have implemented this workaround until the issue is
resolved:

    context.setGeneratingDebug( true );
    context.setOptimizationLevel( 0 );
    try
    {
        sourceReader = new FileReader( myScriptFile );
        myScript = context.compileReader(
            sourceReader,
            myScriptFile.getName(),
            1,
            null );
    }
    catch ( VerifyError e )
    {
        sourceReader.close();
        context.setOptimizationLevel( -1 );
        sourceReader = new FileReader( myScriptFile );
        myScript = context.compileReader(
            sourceReader,
            myScriptFile.getName(),
            1,
            null );
    }


I realise it's not fantastic for performance, but it does save me
having to fix multiple scripts.
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to