# Code coverage report for lib/parser/ast/elementNode.js

## Statements: 100% (9 / 9) Branches: 100% (2 / 2) Functions: 100% (2 / 2) Lines: 100% (9 / 9) Ignored: none

All files » lib/parser/ast/ » elementNode.js

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    181

    1
    145
    145
    145
    145

    1

    111

    1var BaseExpression = require("./base"),
    ArrayExpression    = require("./array");

    function ElementNodeExpression (nodeName, attributes, childNodes) {
      this.name       = nodeName;
      this.attributes = attributes;
      this.childNodes = childNodes || new ArrayExpression();
      BaseExpression.apply(this, arguments);
    }

    BaseExpression.extend(ElementNodeExpression, {
      type: "elementNode",
      toJavaScript: function () {
        return "element(\"" + this.name + "\", " + this.attributes.toJavaScript() + ", " + this.childNodes.toJavaScript() + ")";
      }
    });

    module.exports = ElementNodeExpression;