Java Nashorn支持JavaScript 模板字符串吗?
当尝试var a = `this is a \n multiline string \n `
时,我得到以下错误:
javax.script.ScriptException: <eval>:1:22 Expected an operand but found error
Java Nashorn支持JavaScript 模板字符串吗?
当尝试var a = `this is a \n multiline string \n `
时,我得到以下错误:
javax.script.ScriptException: <eval>:1:22 Expected an operand but found error
如前所述,ES6功能正在添加到jdk9中。您可以使用--language=es6选项启用es6功能(子集)。