napi_object_seal
napi_status napi_object_seal(napi_env env,
napi_value object); [in] env:调用 Node-API 时所在的环境。[in] object:要封闭的对象。
如果 API 成功,则返回 napi_ok。
【Returns napi_ok if the API succeeded.】
此方法会封闭给定的对象。这可以防止向其添加新属性,并将所有现有属性标记为不可配置。这在 ECMA-262 规范的 第 19.1.2.20 节 中有描述。
【This method seals a given object. This prevents new properties from being added to it, as well as marking all existing properties as non-configurable. This is described in Section 19.1.2.20 of the ECMA-262 specification.】