(object, config, _attributes)
| 54035 | |
| 54036 | Data = (function() { |
| 54037 | function Data(object, config, _attributes) { |
| 54038 | var _bound, _computed, _eval, _expr, _finals, addSpec, bind, change, changed, changes, constant, data, define, digest, dirty, equalors, equals, evaluate, event, expr, finals, flattened, freeform, get, getNS, j, key, len, list, makers, mapTo, name, ns, oldComputed, oldExpr, oldOrig, oldProps, originals, props, ref, ref1, set, shorthand, spec, to, touched, touches, trait, traits, unbind, unique, validate, validators, value, values; |
| 54039 | traits = config.traits, props = config.props, finals = config.finals, freeform = config.freeform; |
| 54040 | data = this; |
| 54041 | if ((object.props != null) && (object.expr != null) && (object.orig != null) && (object.computed != null) && (object.attributes != null)) { |
| 54042 | oldProps = shallowCopy(object.props); |
| 54043 | oldExpr = shallowCopy(object.expr); |
| 54044 | oldOrig = object.orig(); |
| 54045 | oldComputed = object.computed(); |
| 54046 | if ((ref = object.attributes) != null) { |
| 54047 | ref.dispose(); |
| 54048 | } |
| 54049 | } |
| 54050 | flattened = {}; |
| 54051 | originals = {}; |
| 54052 | mapTo = {}; |
| 54053 | to = function(name) { |
| 54054 | var ref1; |
| 54055 | return (ref1 = mapTo[name]) != null ? ref1 : name; |
| 54056 | }; |
| 54057 | define = function(name, alias) { |
| 54058 | if (mapTo[alias]) { |
| 54059 | throw new Error((object.toString()) + " - Duplicate property `" + alias + "`"); |
| 54060 | } |
| 54061 | return mapTo[alias] = name; |
| 54062 | }; |
| 54063 | get = function(key) { |
| 54064 | var ref1, ref2, ref3; |
| 54065 | return (ref1 = (ref2 = data[key]) != null ? ref2.value : void 0) != null ? ref1 : (ref3 = data[to(key)]) != null ? ref3.value : void 0; |
| 54066 | }; |
| 54067 | set = function(key, value, ignore, initial) { |
| 54068 | var attr, ref1, short, valid, validated; |
| 54069 | key = to(key); |
| 54070 | if ((attr = data[key]) == null) { |
| 54071 | if (!freeform) { |
| 54072 | throw new Error((object.toString()) + " - Setting unknown property `" + key + "={" + value + "}`"); |
| 54073 | } |
| 54074 | attr = data[key] = { |
| 54075 | short: key, |
| 54076 | type: null, |
| 54077 | last: null, |
| 54078 | value: null |
| 54079 | }; |
| 54080 | validators[key] = function(v) { |
| 54081 | return v; |
| 54082 | }; |
| 54083 | } |
| 54084 | if (!ignore) { |
| 54085 | if (_expr[key]) { |
| 54086 | throw new Error((object.toString()) + " - Can't set bound property `" + key + "={" + value + "}`"); |
| 54087 | } |
| 54088 | if (_computed[key]) { |
| 54089 | throw new Error((object.toString()) + " - Can't set computed property `" + key + "={" + value + "}`"); |
| 54090 | } |
| 54091 | if (_finals[key]) { |
| 54092 | throw new Error((object.toString()) + " - Can't set final property `" + key + "={" + value + "}`"); |
| 54093 | } |
| 54094 | } |
nothing calls this directly
no test coverage detected