Log Message: |
PIVOT-965: Fix an issue with Java 8 (Nashorn script engine) and the way
we deal with included scripts. The problem is that in creating the new
serializer for the included script, the script engine ends up creating a
new "nashorn.global" context, which does not include any previous defined
variables or functions. This new context persists as the current "global"
context after the included script has been read. Then when attempting to
look up any variables/functions defined before the "include" they won't be
found.
The "solution" (or workaround) is to detect when the new global context is
being established and copy the old definitions into it. Now, that sort of
begs the question as to:
* Is this the right place to do this?
* What about the situation when "inline" is false for the included script?
* What about multiple includes?
* What about nested includes?
These are still unanswered questions needing more research. So, for now,
just add the workaround (and some of the debug code still there, but
commented out).
This is a merge of revision 1728247 from trunk to branches/2.0.x.
|