docs: protected void defineOwnProperty(Context cx, Object id, ScriptableObject desc,
                                       boolean checkValid) {
  
          Slot slot = getSlot(cx, id, SlotAccess.QUERY);
          boolean isNew = slot == null;
  
          if (checkValid) {
              ScriptableObject current = slot == null ?
                      null : slot.getPropertyDescriptor(cx, this);
              checkPropertyChange(id, current, desc);
          }
  
          boolean isAccessor = isAccessorDescriptor(desc);
          final int attributes;
  
          if (slot == null) { // new slot
              slot = getSlot(cx, id, isAccessor ? SlotAccess.MODIFY_GETTER_SETTER : SlotAccess.MODIFY);
              attributes = applyDescriptorToAttributeBitset(DONTENUM|READONLY|PERMANENT, desc);
          } else {
              attributes = applyDescriptorToAttributeBitset(slot.getAttributes(), desc);
          }
  
          if (isAccessor) {
              if ( !(slot instanceof GetterSlot) ) {
                  slot = getSlot(cx, id, SlotAccess.MODIFY_GETTER_SETTER);
              }
  
              GetterSlot gslot = (GetterSlot) slot;
  
              Object getter = getProperty(desc, "get");
              if (getter != NOT_FOUND) {
                  gslot.getter = getter;
              }
              Object setter = getProperty(desc, "set");
              if (setter != NOT_FOUND) {
                  gslot.setter = setter;
              }
  
              gslot.value = Undefined.instance;
              gslot.setAttributes(attributes);
          } else {
              if (slot instanceof GetterSlot && isDataDescriptor(desc)) {
                  slot = getSlot(cx, id, SlotAccess.CONVERT_ACCESSOR_TO_DATA);
              }
  
              Object value = getProperty(desc, "value");
              if (value != NOT_FOUND) {
                  slot.value = value;
              } else if (isNew) {
                  slot.value = Undefined.instance;
              }
              slot.setAttributes(attributes);
          }
      }