diff --git a/src/expr/Link.js b/src/expr/Link.js index 813f6818c..9edaea25e 100644 --- a/src/expr/Link.js +++ b/src/expr/Link.js @@ -1,16 +1,16 @@ // TODO: comment link -function Link (scope, name, value) { +math.expr.Link = function Link (scope, name, value) { this.scope = scope; this.name = name; this.value = value; -} +}; /** * Get the links value * @returns {*} value */ -Link.prototype.get = function () { +math.expr.Link.prototype.get = function () { var value = this.value; if (!value) { // try to resolve again @@ -22,7 +22,7 @@ Link.prototype.get = function () { } // resolve a chain of links - while (value instanceof Link) { + while (value instanceof math.expr.Link) { value = value.get(); } @@ -33,6 +33,6 @@ Link.prototype.get = function () { * Set the value for the link * @param {*} value */ -Link.prototype.set = function (value) { +math.expr.Link.prototype.set = function (value) { this.value = value; }; diff --git a/src/expr/Scope.js b/src/expr/Scope.js index 554aad11a..3a7c46bb0 100644 --- a/src/expr/Scope.js +++ b/src/expr/Scope.js @@ -71,7 +71,7 @@ math.expr.Scope.prototype = { /** * create a symbol * @param {String} name - * @return {Link} symbol + * @return {math.expr.Link} symbol * @private */ createSymbol: function (name) { @@ -81,7 +81,7 @@ math.expr.Scope.prototype = { var lastDef = this.findDef(name); // create a new symbol - symbol = new Link(this, name, lastDef); + symbol = new math.expr.Link(this, name, lastDef); this.symbols[name] = symbol; } @@ -91,7 +91,7 @@ math.expr.Scope.prototype = { /** * create a link to a value. * @param {String} name - * @return {Link} symbol + * @return {math.expr.Link} symbol */ createLink: function (name) { var symbol = this.links[name]; @@ -107,7 +107,7 @@ math.expr.Scope.prototype = { * Returns the created symbol * @param {String} name * @param {*} [value] - * @return {Link} symbol + * @return {math.expr.Link} symbol */ createDef: function (name, value) { if (this.readonly) { @@ -129,7 +129,7 @@ math.expr.Scope.prototype = { * Create a variable update definition * Returns the created symbol * @param {String} name - * @return {Link} symbol + * @return {math.expr.Link} symbol */ createUpdate: function (name) { if (this.readonly) { @@ -148,11 +148,11 @@ math.expr.Scope.prototype = { * Create a constant * @param {String} name * @param {*} value - * @return {Link} symbol + * @return {math.expr.Link} symbol * @private */ createConstant: function (name, value) { - var symbol = new Link(this, name, value); + var symbol = new math.expr.Link(this, name, value); this.symbols[name] = symbol; this.defs[name] = symbol; return symbol; @@ -163,7 +163,7 @@ math.expr.Scope.prototype = { * If the symbol is not found in this scope, it will be looked up in its parent * scope. * @param {String} name - * @return {Link | undefined} symbol, or undefined when not found + * @return {math.expr.Link | undefined} symbol, or undefined when not found */ findDef: function (name) { var symbol; diff --git a/src/expr/node/Assignment.js b/src/expr/node/Assignment.js index 7c87b3b40..fb6a0ab7f 100644 --- a/src/expr/node/Assignment.js +++ b/src/expr/node/Assignment.js @@ -3,7 +3,7 @@ * @param {String} name Symbol name * @param {Node[] | undefined} params Zero or more parameters * @param {Node} expr The expression defining the symbol - * @param {Link} result placeholder for the result + * @param {math.expr.Link} result placeholder for the result */ function Assignment(name, params, expr, result) { this.name = name; diff --git a/src/expr/node/FunctionAssignment.js b/src/expr/node/FunctionAssignment.js index 2f71bfa5b..2b63b74bc 100644 --- a/src/expr/node/FunctionAssignment.js +++ b/src/expr/node/FunctionAssignment.js @@ -6,7 +6,7 @@ * @param {String[]} variableNames Variable names * @param {function[]} variables Links to the variables in a scope * @param {Node} expr The function expression - * @param {Link} result Link to store the result + * @param {math.expr.Link} result Link to store the result */ function FunctionAssignment(name, variableNames, variables, expr, result) { this.name = name; diff --git a/src/expr/node/Symbol.js b/src/expr/node/Symbol.js index b4cd22199..68f804d5f 100644 --- a/src/expr/node/Symbol.js +++ b/src/expr/node/Symbol.js @@ -3,7 +3,7 @@ * A symbol can hold and evaluate a link to a value or function defined in a * scope. * @param {String} [name] - * @param {Link} link + * @param {math.expr.Link} link * @extends {Node} */ function Symbol(name, link) {