Nashorn 中的 ECMA 6 支持

Ala*_*lan 5 javascript nashorn

我刚刚尝试了Nashorn,似乎不支持Array.prototype.fill。这令人惊讶吗?Nashorn 的预期支持是否有时间表?目前在 Nashorn 中获取 5 个 0 数组的最佳方法是吗Array.apply(null, Array(5)).map(x=>0)

Pan*_*gic 3

似乎 Java9 中有对 ES6 的部分支持,稍后还会有更多支持: https://www.oracle.com/corporate/features/nashorn-javascript-engine-jdk9.html

另请参阅: http://openjdk.java.net/jeps/292