Issue1400

classification
Title: Evaluating expression via JSR 223 ScriptEngine returns null instead of True/False
Type: behaviour Severity: normal
Components: Versions: 2.2.2
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: heuermh, nriley
Priority: Keywords:

Created on 2009-07-15.20:20:03 by heuermh, last changed 2009-09-14.16:55:48 by heuermh.

Files
File name Uploaded Description Edit Remove
Example.java heuermh, 2009-07-15.20:20:03 Example.java source, evaluating expressions via JSR 223 ScriptEngine
Messages
msg4907 (view) Author: Michael Heuer (heuermh) Date: 2009-07-15.20:20:03
Expressions in interpreter evaluate to True or False

Jython 2.5.0 (Release_2_5_0:6476, Jun 16 2009, 13:33:26)
[Java HotSpot(TM) Client VM (Sun Microsystems Inc.)] on java1.6.0_14
Type "help", "copyright", "credits" or "license" for more information
>>> True
True
>>> (None is None)
True

but when evaluated by a JSR 223 ScriptEngine fail to return a value:

$ java Example
result: null
result: null

See attached Example.java.

This is with jython-engine.jar from https://scripting.dev.java.net dated
08 aug 2008 and jython.jar version 2.2.1 (the most recent I could find
in the maven central repository).
msg4914 (view) Author: Nicholas Riley (nriley) Date: 2009-07-17.05:37:21
I've started work on a usable 2.5 JSR 223 implementation.  While it's not 
finished by a long shot (the JSR 223 interface is pretty huge), the current 
implementation should be enough for you to test with.

Check out https://jython.svn.sourceforge.net/svnroot/jython/branches/jsr223/, 
build it (ant) and dist/jython-dev.jar should be usable as a JSR 223 engine.
msg4932 (view) Author: Michael Heuer (heuermh) Date: 2009-07-20.17:00:49
Good news is that the attached Example now works:

$ java Example
result: true
result: true

I will need ScriptEngine.eval(Reader), which currently throws an
UnsupportedOperationException, and the setting of context variables,
which seems not to work

engine.put("a", 42);
engine.eval("print a");

NameError: name 'a' is not defined in <script> at line number 1

Those are both separate issues though.  I will keep an eye to progress
on the jsr223 branch, thank you.
msg4935 (view) Author: Nicholas Riley (nriley) Date: 2009-07-22.23:52:46
Bindings support and Reader support is in.
msg4937 (view) Author: Nicholas Riley (nriley) Date: 2009-07-23.05:22:49
The JSR 223 branch has been merged into trunk.  Please test it and file 
(additional) bugs if you run into any issues.

Thanks.
msg5162 (view) Author: Michael Heuer (heuermh) Date: 2009-09-14.16:47:49
Sorry for commenting on a closed/fixed issue.  I don't see the
org/python/jsr233 package in the 2.5.1rc2 release.  Was this an
oversight or were the JSR233 classes excluded purposely?
msg5163 (view) Author: Michael Heuer (heuermh) Date: 2009-09-14.16:55:48
On second look, the JSR223 package is in the 2.5.1rc2 jython.jar, and is
present in SVN tags/Release_2_5_1rc2.  Never mind.
History
Date User Action Args
2009-09-14 16:55:48heuermhsetmessages: + msg5163
2009-09-14 16:47:49heuermhsetmessages: + msg5162
2009-07-23 05:22:49nrileysetstatus: open -> closed
resolution: fixed
messages: + msg4937
2009-07-22 23:52:46nrileysetmessages: + msg4935
2009-07-20 17:00:49heuermhsetmessages: + msg4932
2009-07-17 05:37:22nrileysetnosy: + nriley
messages: + msg4914
2009-07-15 20:20:03heuermhcreate