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

## Statements: 91.67% (11 / 12) Branches: 50% (2 / 4) Functions: 100% (2 / 2) Lines: 91.67% (11 / 12) Ignored: none

All files » lib/parser/ast/ » blockBinding.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
    251

    1
    149
    149
    149
    149

    1

    71

    71

    71

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

    function BlockBindingExpression(scripts, contentTemplate, childBlock) {
      this.scripts    = scripts;
      this.contentTemplate = contentTemplate;
      this.childBlock = childBlock;
      BaseExpression.apply(this, arguments);
    }

    BaseExpression.extend(BlockBindingExpression, {
      type: "blockBinding",
      toJavaScript: function() {

        var buffer = "block("+ this.scripts.value.value.toJavaScript() +", " + (this.contentTemplate ? this.contentTemplate.toJavaScript() : "void 0");

        Iif (this.childBlock) {
          buffer += ", " + this.childBlock.toJavaScript();
        }

        return buffer + ")";
      }
    });

    module.exports = BlockBindingExpression;