From 20b0f51ba7b42b1e13ab62ef60eee2507a50345a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=99=A8=E9=98=B3?= Date: Sun, 5 Jul 2015 19:58:59 +0800 Subject: [PATCH] fix#8 --- lib/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index 8de471e..920ce36 100644 --- a/lib/index.js +++ b/lib/index.js @@ -269,7 +269,8 @@ const formatInfo = operator => { * Grouped expression based on precedences */ 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)) { stack.splice(index, 1, sortStack(item)); } @@ -333,7 +334,8 @@ const evaluate = stack => { * The operator object or null if no operator is found */ const findOperator = arr => { - for (let o of arr) { + for (let index = 0; index < arr.length; ++index) { + let o = arr[index]; if (typeof o === 'string') { return o; }