Esempio n. 1
0
def _define_template_strings(traverser, node):
    """Instantiate an array of raw and cooked template strings."""
    cooked = JSArray()
    cooked.elements = map(traverser._traverse_node, node['cooked'])
    raw = JSArray()
    raw.elements = map(traverser._traverse_node, node['raw'])

    cooked.set('raw', raw, traverser)
    return cooked
Esempio n. 2
0
def _define_template_strings(traverser, node):
    """Instantiate an array of raw and cooked template strings."""
    cooked = JSArray()
    cooked.elements = map(traverser._traverse_node, node["cooked"])
    raw = JSArray()
    raw.elements = map(traverser._traverse_node, node["raw"])

    cooked.set("raw", raw, traverser)
    return cooked
Esempio n. 3
0
def _define_array(traverser, node):
    """Instantiate an array object from the parse tree."""
    arr = JSArray()
    arr.elements = map(traverser._traverse_node, node['elements'])
    return arr
Esempio n. 4
0
def array_global(wrapper, arguments, traverser):
    output = JSArray()
    if arguments:
        output.elements = [traverser._traverse_node(a) for a in arguments]
    return JSWrapper(output, traverser=traverser)
Esempio n. 5
0
def array_global(wrapper, arguments, traverser):
    output = JSArray()
    if arguments:
        output.elements = [traverser._traverse_node(a) for a in arguments]
    return JSWrapper(output, traverser=traverser)
Esempio n. 6
0
def _define_array(traverser, node):
    """Instantiate an array object from the parse tree."""
    arr = JSArray()
    arr.elements = map(traverser._traverse_node, node["elements"])
    return arr
Esempio n. 7
0
def ArrayExpression(traverser, node):
    return JSArray(
        [traverser.traverse_node(x) for x in node["elements"] or []])