Record.js 390 B

12345678910111213141516171819202122
  1. define(function () {
  2. /**
  3. * Simple implementation of the Record abstract data type from ECMA 402.
  4. *
  5. * @constructor
  6. * @private
  7. */
  8. var Record = function () {
  9. this.length = 0;
  10. };
  11. Record.prototype.set = function (field, val) {
  12. Object.defineProperty(this, field, {
  13. value : val,
  14. writable : true,
  15. enumerable : true,
  16. configurable : true
  17. });
  18. };
  19. return Record;
  20. });