How can I get the version of Rhino from within javascript?
Asked Answered
B

1

5

Is there any way of getting the current version of Rhino within the javascript it is interpreting?

Borgerhout answered 10/4, 2014 at 13:45 Comment(0)
L
11

This way:

var Context = org.mozilla.javascript.Context,
    currentContext = Context.getCurrentContext(),
    rhinoVersion = currentContext.getImplementationVersion();

print(rhinoVersion);

The output for the currently stable release:

Rhino 1.7 release 4 2012 06 18
Laminated answered 10/4, 2014 at 14:23 Comment(2)
Awesome! Exactly what I was looking for!Borgerhout
What if the above returns null?Shoring

© 2022 - 2024 — McMap. All rights reserved.