fix#8
This commit is contained in:
parent
3730e8308f
commit
20b0f51ba7
@ -269,7 +269,8 @@ const formatInfo = operator => {
|
|||||||
* Grouped expression based on precedences
|
* Grouped expression based on precedences
|
||||||
*/
|
*/
|
||||||
const sortStack = stack => {
|
const sortStack = stack => {
|
||||||
for (let [index, item] of stack.entries()) {
|
for (let index = 0; index < stack.length; ++index) {
|
||||||
|
let item = stack[index];
|
||||||
if (Array.isArray(item)) {
|
if (Array.isArray(item)) {
|
||||||
stack.splice(index, 1, sortStack(item));
|
stack.splice(index, 1, sortStack(item));
|
||||||
}
|
}
|
||||||
@ -333,7 +334,8 @@ const evaluate = stack => {
|
|||||||
* The operator object or null if no operator is found
|
* The operator object or null if no operator is found
|
||||||
*/
|
*/
|
||||||
const findOperator = arr => {
|
const findOperator = arr => {
|
||||||
for (let o of arr) {
|
for (let index = 0; index < arr.length; ++index) {
|
||||||
|
let o = arr[index];
|
||||||
if (typeof o === 'string') {
|
if (typeof o === 'string') {
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user