xmlgraphics-batik-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 47257] New: The class RhinoClassShutter disables instantiation of org.mozilla.javascript.EcmaError preventing handling of certain Javascript errors
Date Sat, 23 May 2009 20:19:00 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=47257

           Summary: The class RhinoClassShutter disables instantiation of
                    org.mozilla.javascript.EcmaError preventing handling
                    of certain Javascript errors
           Product: Batik
           Version: 1.7
          Platform: All
        OS/Version: Mac OS X 10.4
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Scripting
        AssignedTo: batik-dev@xmlgraphics.apache.org
        ReportedBy: vgoenka@apache.org


I have a block of Javascript code that does something like:

try {
  //reference some undeclared variable
} catch (e) {}

This causes Rhino to generate an EcmaError, which it then tries to wrap in a
Java object. However the RhinoClassShutter prevents accessing all rhino classes
(for good reason) including the EcmaError class, thereby negating the
usefulness of try/catch. 

Perhaps the RhinoClassShutter should allow exception/error classes to be
referenced/instantiated even if they are in the org.mozilla.javascript package.
The only work around (other than making sure the Javascript never generates an
EcmaError) seems to be to replace RhinoInterpreterFactory with your own, just
to override the RhinoClassShutter, which has some more quirks if you are using
the batik jars (which also install the RhinoInterpreterFactory). 


Access to Java class "org.mozilla.javascript.EcmaError" is prohibited. (Inline
<script> http://....:-1#4)
    at
org.apache.batik.transcoder.SVGAbstractTranscoder$SVGAbstractTranscoderUserAgent.displayError(SVGAbstractTranscoder.java:863)
    at
org.apache.batik.bridge.BaseScriptingEnvironment.handleInterpreterException(BaseScriptingEnvironment.java:694)
    at
org.apache.batik.bridge.BaseScriptingEnvironment.loadScripts(BaseScriptingEnvironment.java:522)
    at
org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:214)
    at
org.apache.batik.transcoder.image.ImageTranscoder.transcode(ImageTranscoder.java:92)
    at
org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstractTranscoder.java:142)
    at
org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:156)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org


Mime
View raw message