def METHOD_NAME(value, stack, gap, property_list, replacer_function, space):
    global indent
    if value in stack:
        raise MakeError('TypeError', 'Converting circular structure to JSON')
    stack.add(value)
    stepback = indent
    indent += gap
    partial = []
    length = js_arr_length(value)
    for index in xrange(length):
        index = unicode(index)
        str_index = Str(index, value, replacer_function, property_list, gap,
                        stack, space)
        if is_undefined(str_index):
            partial.append('null')
        else:
            partial.append(str_index)
    if not partial:
        final = '[]'
    else:
        if not gap:
            final = '[%s]' % ','.join(partial)
        else:
            sep = ',\n' + indent
            properties = sep.join(partial)
            final = '[\n' + indent + properties + '\n' + stepback + ']'
    stack.remove(value)
    indent = stepback
    return final