

# 适用于 CloudFront Functions 的 JavaScript 运行时系统特征
<a name="functions-javascript-runtime-features"></a>

CloudFront Functions JavaScript 运行时系统环境符合 [ECMAScript (ES) 5.1](https://www.ecma-international.org/ecma-262/5.1/) 的要求，也支持 ES 版本 6 至 9 的某些特征。

为了获得最新的功能，建议您使用 JavaScript 运行时 2.0。

与 1.0 相比，JavaScript 运行时 2.0 有以下变化：
+ 可使用缓冲区模块方法
+ 以下非标准字符串原型方法不可用：
  + `String.prototype.bytesFrom()`
  + `String.prototype.fromBytes()`
  + `String.prototype.fromUTF8()`
  + `String.prototype.toBytes()`
  + `String.prototype.toUTF8()`
+ 加密模块包含以下更改：
  + `hash.digest()` - 如果未提供编码，则返回类型更改为 `Buffer`
  + `hmac.digest()` - 如果未提供编码，则返回类型更改为 `Buffer`
+ 有关其他新功能的更多信息，请参阅[适用于 CloudFront Functions 的 JavaScript 运行时系统 2.0 特征](functions-javascript-runtime-20.md)。

**Topics**
+ [JavaScript 运行时 1.0 功能](functions-javascript-runtime-10.md)
+ [JavaScript 运行时系统 2.0 特征](functions-javascript-runtime-20.md)