| 34 | }; |
| 35 | |
| 36 | static Napi::Value GetPrototype(Napi::Env env, Napi::Object obj) { |
| 37 | napi_value proto; |
| 38 | // This can fail (e.g., a Proxy whose getPrototypeOf trap throws), in |
| 39 | // which case an empty value is returned and an exception is pending. |
| 40 | if (napi_get_prototype(env, obj, &proto) != napi_ok) return Napi::Value(); |
| 41 | return Napi::Value(env, proto); |
| 42 | } |
| 43 | |
| 44 | // An object is "plain" if its prototype is null or a top-level prototype |
| 45 | // (i.e., some realm's Object.prototype). Rather than comparing against the |
nothing calls this directly
no outgoing calls
no test coverage detected