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

## Statements: 100% (10 / 10) Branches: 100% (0 / 0) Functions: 100% (3 / 3) Lines: 100% (9 / 9) Ignored: none

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

    1
    18
    18
    18

    1

    1

    1

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

    /**
     */

    function AssignmentExpression(reference, value) {
      BaseExpression.apply(this, arguments);
      this.reference = reference;
      this.value     = value;
    }

    /**
     */

    BaseExpression.extend(AssignmentExpression, {

      /**
       */

      type: "assignment",

      /**
       */

      toJavaScript: function() {

        var path = this.reference.path.map(function(p) { return "'"+p+"'"; }).join(", ");

        return "this.set([" + path + "], " + this.value.toJavaScript() + ")";
      }
    });

    module.exports = AssignmentExpression;