-
Bug
-
Resolution: Fixed
-
P2
-
9
-
None
-
b13
-
generic
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8045096 | 8u25 | Sundararajan Athijegannathan | P2 | Resolved | Fixed | b01 |
JDK-8042442 | 8u20 | Sundararajan Athijegannathan | P2 | Closed | Fixed | b15 |
JDK-8052496 | emb-8u26 | Sundararajan Athijegannathan | P2 | Resolved | Fixed | b18 |
Many existing scripts, especially node modules, use 'const' and so fail on Nashorn. As far as I can tell, a simple string replace with 'var' works just fine, but obviously Nashorn can do this much more effectively.
A new Options argument (even undocumented) would be perfect, e.g.
nashorn.option.const.as.var = {
name="--const-as-var",
is_undocumented=true,
desc="Replace 'const' with 'var'.",
type=Boolean
}
FWIW, our use case would pass it via NashornScriptEngineFactory.getScriptEngine().
A new Options argument (even undocumented) would be perfect, e.g.
nashorn.option.const.as.var = {
name="--const-as-var",
is_undocumented=true,
desc="Replace 'const' with 'var'.",
type=Boolean
}
FWIW, our use case would pass it via NashornScriptEngineFactory.getScriptEngine().
- backported by
-
JDK-8045096 Add --const-as-var option
- Resolved
-
JDK-8052496 Add --const-as-var option
- Resolved
-
JDK-8042442 Add --const-as-var option
- Closed
- relates to
-
JDK-8019962 const is not defined
- Closed