MCPcopy Create free account
hub / github.com/Distributive-Network/PythonMonkey / JSObjectProxy_clear_method

Method JSObjectProxy_clear_method

src/JSObjectProxy.cc:718–733  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

716}
717
718PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_clear_method(JSObjectProxy *self) {
719 JS::RootedIdVector props(GLOBAL_CX);
720 if (!js::GetPropertyKeys(GLOBAL_CX, *(self->jsObject), JSITER_OWNONLY, &props))
721 {
722 PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name);
723 return NULL;
724 }
725
726 JS::ObjectOpResult ignoredResult;
727 size_t length = props.length();
728 for (size_t index = 0; index < length; index++) {
729 JS_DeletePropertyById(GLOBAL_CX, *(self->jsObject), props[index], ignoredResult);
730 }
731
732 Py_RETURN_NONE;
733}
734
735PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_copy_method(JSObjectProxy *self) {
736 JS::Rooted<JS::ValueArray<2>> args(GLOBAL_CX);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected