Property.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. var INSPECTOR;
  2. (function (INSPECTOR) {
  3. /**
  4. * A property is a link between a data (string) and an object.
  5. */
  6. var Property = (function () {
  7. function Property(prop, obj) {
  8. this._property = prop;
  9. this._obj = obj;
  10. }
  11. Object.defineProperty(Property.prototype, "name", {
  12. get: function () {
  13. return this._property;
  14. },
  15. enumerable: true,
  16. configurable: true
  17. });
  18. Object.defineProperty(Property.prototype, "value", {
  19. get: function () {
  20. return this._obj[this._property];
  21. },
  22. set: function (newValue) {
  23. this._obj[this._property] = newValue;
  24. },
  25. enumerable: true,
  26. configurable: true
  27. });
  28. Object.defineProperty(Property.prototype, "type", {
  29. get: function () {
  30. return INSPECTOR.Helpers.GET_TYPE(this.value);
  31. },
  32. enumerable: true,
  33. configurable: true
  34. });
  35. Object.defineProperty(Property.prototype, "obj", {
  36. get: function () {
  37. return this._obj;
  38. },
  39. set: function (newObj) {
  40. this._obj = newObj;
  41. },
  42. enumerable: true,
  43. configurable: true
  44. });
  45. return Property;
  46. }());
  47. INSPECTOR.Property = Property;
  48. })(INSPECTOR || (INSPECTOR = {}));
  49. //# sourceMappingURL=Property.js.map