jakarta-bsf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabrício Matheus Gonçalves <fmath...@bigbross.com>
Subject JavaScriptEngine.declareBean bug?
Date Tue, 28 Jan 2003 17:58:25 GMT

Hi

Im glad bsf is now at jakarta.
So my problem is when i declare some Number, String or Boolean,
that appear into script as object.

I think the problem is below line, it is wrapping all objects instead of
just the non-scriptable ones. We could make intanceof of the
bean.type to avoid wrap Number, String e Boolean.

    public void declareBean(BSFDeclaredBean bean) throws BSFException {
        // Must wrap non-scriptable objects before presenting to Rhino
>>>     Scriptable wrapped = Context.toObject(bean.bean, global);
        global.put(bean.name, global, wrapped);
    }


PS: I could send a patch, if you want.


Mime
View raw message