# Code coverage report for lib/script/ref.js

## Statements: 91.67% (11 / 12) Branches: 100% (4 / 4) Functions: 66.67% (2 / 3) Lines: 90% (9 / 10) Ignored: none

All files » lib/script/ » ref.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
    16
    16
    16

    1

    16
    8

    1
     var protoclass = require("protoclass");

    function BindableReference (script, path, settable) {
      this.script   = script;
      this.path     = path;
      this.settable = settable;
    }

    protoclass(BindableReference, {
      __isBindableReference: true,
      value: function (value) {
        if (!arguments.length) return this.script.get(this.path);
        if (this.settable) this.script.set(this.path, value);
      },
      toString: function () {
        return this.script.get(this.path);
      }
    });

    module.exports = BindableReference;