# Code coverage report for lib/parser/index.js

## Statements: 90.91% (10 / 11) Branches: 75% (3 / 4) Functions: 50% (1 / 2) Lines: 90.91% (10 / 11) Ignored: none

All files » lib/parser/ » index.js

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    361

    1

    1

    171

    171
    34

    137
    137

    137

    137

     var parser = require("./parser");

    var scripts = {}, parse;

    /**
     */

    module.exports = {

      /**
       */

      parse: parse = function(html) {
        return '"use strict";' + "module.exports = " + parser.parse(html).toJavaScript();
      },

      /**
       */

      compile: function(nameOrContent) {
        var content;

        if (scripts[nameOrContent]) {
          return scripts[nameOrContent];
        }

        Eif (!content) {
          content = nameOrContent;
        }

        var source = '"use strict";return '+parser.parse(content).toJavaScript();

        return (scripts[nameOrContent] = new Function(source)());
      }
    };