GitHub user woonsan opened a pull request:
https://github.com/apache/commons-scxml/pull/1
Feature/scxml 234 js evaluator
Fixed ScriptTest unit test failure.
The root cause was as follows:
- In Java 1.8, the global object ("nashorn.global") is not shared with the
engine-level bindings any more. Therefore, after evaluating a script, you
should retrieve the global to read it:
Object nashornGlobal = ((Bindings)obj).get("nashorn.global");
- Fixed JSEvaluator by copying global variables after evaluation to the
SCXML Context object.
- Change JSContext to be aligned with other context objects by using
EffectiveContextMap like JexlContext and JexlEvaluator do.
[1]
https://wiki.openjdk.java.net/display/Nashorn/Nashorn+jsr223+engine+notes
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/woonsan/commons-scxml
feature/SCXML-234-JSEvaluator
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/commons-scxml/pull/1.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1
----
commit 509cb24e2c759eb17556fd3d2a158e3fdf60ab69
Author: Woonsan Ko <[email protected]>
Date: 2015-07-11T19:58:41Z
SCXML-234 adding a unit test to test JavaScriptEngine itself
commit 8691eb95522d9421a8b2883bf65e535d581f1a06
Author: Woonsan Ko <[email protected]>
Date: 2015-07-11T20:00:52Z
SCXML-234 adding a unit test to test JavaScriptEngine itself to validate if
we can have a common code to make it work in both Java 1.8 or earlier versions
commit 6eb761413871082d2ea128d8e132dd5ac06bbf4f
Author: Woonsan Ko <[email protected]>
Date: 2015-07-11T20:46:43Z
SCXML-234 fixing unit test failure in ScriptTest
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---