PageRenderTime 42ms CodeModel.GetById 38ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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

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