| 177 | } |
| 178 | |
| 179 | static inline void assignKeyValue(JSObjectProxy *self, PyObject *key, JS::HandleId id, PyObject *value) { |
| 180 | if (value) { // we are setting a value |
| 181 | JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); |
| 182 | JS_SetPropertyById(GLOBAL_CX, *(self->jsObject), id, jValue); |
| 183 | } else { // we are deleting a value |
| 184 | JS::ObjectOpResult ignoredResult; |
| 185 | JS_DeletePropertyById(GLOBAL_CX, *(self->jsObject), id, ignoredResult); |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | int JSObjectProxyMethodDefinitions::JSObjectProxy_assign(JSObjectProxy *self, PyObject *key, PyObject *value) |
| 190 | { |
no test coverage detected