def METHOD_NAME(obj, prop, attrs):
    if not obj.is_object():
        raise MakeError('TypeError',
                        'Object.defineProperty called on non-object')
    name = prop.to_string().value
    if not obj.define_own_property(name, ToPropertyDescriptor(attrs)):
        raise MakeError('TypeError', 'Cannot redefine property: %s' % name)
    return obj