Skip to content
This repository was archived by the owner on Aug 29, 2024. It is now read-only.

replace null to undefined #262

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/Symbols.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Symbols.getSymbolsInExpression = function(expression) {
};

// Iterates through a node and returns the last term with the symbol name
// Returns null if no terms with the symbol name are in the node.
// Returns undefined if no terms with the symbol name are in the node.
// e.g. 4x^2 + 2x + y + 2 with `symbolName=x` would return 2x
Symbols.getLastSymbolTerm = function(node, symbolName) {
// First check if the node itself is a polyomial term with symbolName
Expand All @@ -43,7 +43,7 @@ Symbols.getLastSymbolTerm = function(node, symbolName) {
return Symbols.getLastSymbolTerm(node.content, symbolName);
}

return null;
return undefined;
};

// Iterates through a node and returns the last term that does not have the
Expand All @@ -57,7 +57,7 @@ Symbols.getLastNonSymbolTerm = function(node, symbolName) {
return new Node.PolynomialTerm(node).getCoeffNode();
}
else if (hasDenominatorSymbol(node, symbolName)) {
return null;
return undefined;
}
else if (Node.Type.isOperator(node)) {
for (let i = node.args.length - 1; i >= 0 ; i--) {
Expand All @@ -71,7 +71,7 @@ Symbols.getLastNonSymbolTerm = function(node, symbolName) {
}
}

return null;
return undefined;
};

// Iterates through a node and returns the denominator if it has a
Expand All @@ -98,7 +98,7 @@ Symbols.getLastDenominatorWithSymbolTerm = function(node, symbolName) {
}
}
}
return null;
return undefined;
};

// Returns if `node` is a term with symbol `symbolName`
Expand Down