| 63 | } |
| 64 | |
| 65 | inline Napi::Value SafeGetElement(Napi::Env env, Napi::Object obj, uint32_t index) { |
| 66 | napi_value result; |
| 67 | if (napi_get_element(env, obj, index, &result) != napi_ok) return Napi::Value(); |
| 68 | return Napi::Value(env, result); |
| 69 | } |
| 70 | |
| 71 | // Returns false if the check itself failed (leaving an exception pending). |
| 72 | inline bool SafeHasOwnProperty(Napi::Env env, Napi::Object obj, napi_value key, bool* result) { |