| 62 | } |
| 63 | |
| 64 | bool gjs_define_enum_values(JSContext* cx, JS::HandleObject in_object, |
| 65 | const GI::EnumInfo& info) { |
| 66 | /* Fill in enum values first, so we don't define the enum itself until we're |
| 67 | * sure we can finish successfully. |
| 68 | */ |
| 69 | auto iter = info.values(); |
| 70 | return std::all_of(iter.begin(), iter.end(), |
| 71 | [cx, in_object](const GI::AutoValueInfo& value_info) { |
| 72 | return gjs_define_enum_value(cx, in_object, |
| 73 | value_info); |
| 74 | }); |
| 75 | } |
| 76 | |
| 77 | bool gjs_define_enumeration(JSContext* cx, JS::HandleObject in_object, |
| 78 | const GI::EnumInfo& info) { |
no test coverage detected