* StructInstance::new_for_c_struct: * * Creates a new StructInstance JS object from a C boxed struct pointer. * * There are two overloads of this method; the NoCopy overload will simply take * the passed-in pointer but not own it, while the normal method will take a * reference, or if the boxed type can be directly allocated, copy the memory. */
| 132 | * reference, or if the boxed type can be directly allocated, copy the memory. |
| 133 | */ |
| 134 | JSObject* StructInstance::new_for_c_struct(JSContext* cx, |
| 135 | const GI::StructInfo& info, |
| 136 | void* gboxed) { |
| 137 | JS::RootedObject obj{cx, new_for_c_struct_impl(cx, info, gboxed)}; |
| 138 | if (!obj || !define_extra_error_properties(cx, obj)) |
| 139 | return nullptr; |
| 140 | return obj; |
| 141 | } |
| 142 | |
| 143 | JSObject* StructInstance::new_for_c_struct(JSContext* cx, |
| 144 | const GI::StructInfo& info, |
nothing calls this directly
no test coverage detected