PageRenderTime 21ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/jsdoc_toolkit-1.4.0/test/data/properties.js

http://jsdoc-toolkit.googlecode.com/
JavaScript | 45 lines | 26 code | 8 blank | 11 comment | 3 complexity | 98600323174714da1bc4af89caa06771 MD5 | raw file
  1. if (Codework == undefined) var Codework = function () {};
  2. /**
  3. * @property {Number} methodId The id of the method.
  4. */
  5. Codework.Method = function (associated_with, code, arity) {
  6. /** @type Object */ this._associated_with = associated_with;
  7. /** @type String */ this._code = code;
  8. /**
  9. * Only used in older browsers.
  10. * @type Boolean */ this._arity = arity || 1;
  11. /** The arguments. */
  12. this._args = [];
  13. }
  14. Codework.Method.CURRENT_CLASS_STACK = [];
  15. Codework.Method.CURRENT_INVOCANT_STACK = [];
  16. Codework.Method.prototype.associated_with = function () {
  17. return this._associated_with;
  18. }
  19. Codework.Method.prototype.arity = function () {
  20. return this._arity;
  21. }
  22. /*
  23. NOTE:
  24. we ignore the arity value for now in call(), it is really
  25. just there to support multi-methods anyway :)
  26. */
  27. Codework.Method.prototype.call = function (inv, args) {
  28. Codework.Method.CURRENT_CLASS_STACK.push(this._associated_with);
  29. Codework.Method.CURRENT_INVOCANT_STACK.push(inv);
  30. var rval = this._code(inv, args);
  31. Codework.Method.CURRENT_INVOCANT_STACK.pop();
  32. Codework.Method.CURRENT_CLASS_STACK.pop();
  33. return rval;
  34. }
  35. Codework.Method.prototype.toString = function () {
  36. return "Codework.Method=[" + this.associated_with() + "]";
  37. }