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

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

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

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    221

    1
    97

    97

    97

    1

    71

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

    function TextNodeExpression(value) {
      this.value = he.decode(value);

      // FIXME:
      // will be invalid if vlaue is something like 'a'
      this.decoded = this.value !== value;

      BaseExpression.apply(this, arguments);
    }

    BaseExpression.extend(TextNodeExpression, {
      type: "textNode",
      toJavaScript: function() {
        return "text(\"" + this.value.replace(/["]/g, "\\\"") + "\")";
      }
    });

    module.exports = TextNodeExpression;