I am using the Rhino version (see title of this post), the log function should work I wonder if I have the right version. Was the log.* object deprecated?
Error:
java org.mozilla.javascript.tools.shell.Main
js> log.info('hello world')
js: uncaught JavaScript runtime exception: ReferenceError: "log" is not defined.
I've checked console.log('hello world')
as well. But it doesn't seem to be defined either.
I don't recall Rhino providing log or console global objects. Neither are standard.
The globals provided by that shell are defined by org.mozilla.javascript.tools.shell.Global
if memory serves. They're documented here.
You probably want the print function:
print([expr ...])
Evaluate and print expressions. Evaluates each expression, converts the result to a string, and prints it.