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

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

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

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

    1
    521
    521

    1

    196

    196
    201
    201

    196

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

    function HashExpression(values) {
      this.value = values;
      BaseExpression.apply(this, arguments);
    }

    BaseExpression.extend(HashExpression, {
      type: "hash",
      toJavaScript: function() {

        var items = [];

        for (var key in this.value) {
          var v = this.value[key];
          items.push("'"+key+"':"+v.toJavaScript());
        }

        return "{" + items.join(", ") + "}";
      }
    });

    module.exports = HashExpression;