Closed FND closed 7 years ago
complate is typically used with faucet, which reports compilation errors directly within the bundle:
(typeof alert !== "undefined" ? alert : console.error)("ERROR: SyntaxError: … Unexpected token …");
However, Nashorn currently doesn't support console.error, using print instead (there's no immediate equivalent for stderr AFAIK). Thus, before evaluating JavaScript code, we should prepend the following:
console.error
print
if(typeof console === "undefined") { var console = { log: print, error: print }; }
(Note that we're already doing something similar for global.)
global
Fixed by #9 .
complate is typically used with faucet, which reports compilation errors directly within the bundle:
However, Nashorn currently doesn't support
console.error
, usingprint
instead (there's no immediate equivalent for stderr AFAIK). Thus, before evaluating JavaScript code, we should prepend the following:(Note that we're already doing something similar for
global
.)