def METHOD_NAME(obj):  # page 38 (50 absolute)
    if obj.TYPE != 'Object':
        raise MakeError('TypeError',
                        'Can\'t convert non-object to property descriptor')
    desc = {}
    if obj.has_property('enumerable'):
        desc['enumerable'] = obj.get('enumerable').to_boolean().value
    if obj.has_property('configurable'):
        desc['configurable'] = obj.get('configurable').to_boolean().value
    if obj.has_property('value'):
        desc['value'] = obj.get('value')
    if obj.has_property('writable'):
        desc['writable'] = obj.get('writable').to_boolean().value
    if obj.has_property('get'):
        cand = obj.get('get')
        if not (cand.is_undefined() or cand.is_callable()):
            raise MakeError(
                'TypeError',
                'Invalid getter (it has to be a function or undefined)')
        desc['get'] = cand
    if obj.has_property('set'):
        cand = obj.get('set')
        if not (cand.is_undefined() or cand.is_callable()):
            raise MakeError(
                'TypeError',
                'Invalid setter (it has to be a function or undefined)')
        desc['set'] = cand
    if ('get' in desc or 'set' in desc) and ('value' in desc
                                             or 'writable' in desc):
        raise MakeError(
            'TypeError',
            'Invalid property.  A property cannot both have accessors and be writable or have a value.'
        )
    return desc