Code coverage report for sc/classlib/Core/Ref.js

Statements: 100% (29 / 29)      Branches: 100% (0 / 0)      Functions: 100% (13 / 13)      Lines: 100% (29 / 29)      Ignored: none     

All files » sc/classlib/Core/ » Ref.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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 701     1   1 1   1 14     1 2         1     1 1     1 1     1 1     1   1 1     1 1     1 1     1 1     1         1 1     1 1                
SCScript.install(function(sc) {
  "use strict";
 
  require("./Object");
 
  sc.lang.klass.refine("Ref", function(builder) {
    builder.addProperty("<>", "value");
 
    builder.addClassMethod("new", function($thing) {
      return this.__super__("new").value_($thing);
    });
 
    builder.addMethod("valueOf", function() {
      return this._$value.valueOf();
    });
 
    // $new
 
    builder.addMethod("set", {
      args: "thing"
    }, function($thing) {
      this._$value = $thing;
      return this;
    });
 
    builder.addMethod("get", function() {
      return this._$value;
    });
 
    builder.addMethod("dereference", function() {
      return this.value();
    });
 
    builder.addMethod("asRef");
 
    builder.addMethod("valueArray", function() {
      return this.value();
    });
 
    builder.addMethod("valueEnvir", function() {
      return this.value();
    });
 
    builder.addMethod("valueArrayEnvir", function() {
      return this.value();
    });
 
    builder.addMethod("next", function() {
      return this.value();
    });
 
    builder.addMethod("asUGenInput");
 
    // TODO: implements printOn
    // TODO: implements storeOn
 
    builder.addMethod("at", function($key) {
      return this._$value.at($key);
    });
 
    builder.addMethod("put", function($key, $val) {
      return this._$value.put($key, $val);
    });
    // TODO: implements seq
    // TODO: implements asControlInput
    // TODO: implements asBufWithValues
    // TODO: implements multichannelExpandRef
  });
});