wrapping java objects which are passed to BSF call method in javascript engine
------------------------------------------------------------------------------

                 Key: BSF-10
                 URL: https://issues.apache.org/jira/browse/BSF-10
             Project: BSF
          Issue Type: Improvement
    Affects Versions: BSF-2.4
            Reporter: Scott Cytacki


The BSF 2.4.0 javascript engine does not wrap the arguments that are passed in
to the call method.  This means for example that in javascript the argument
objects will not be "==" to the same object if it is retrieved through live
connect.  

This can be fixed by using the context.getWrapFactory().wrap method.  So adding
the following code to the JavaScriptEngine fixes this:

            // need to wrap the passed in objects the same as if they were 
handled by live connect
            if(args != null){
                WrapFactory wrapFactory = cx.getWrapFactory();
                for(int i=0; i<args.length; i++){
                        args[i] = wrapFactory.wrap(cx, global, args[i], null);
                }
            }

The code above is licensed under the Apache License 2.0


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to