diff --git a/src/application/worker/store/modules/expressions.js b/src/application/worker/store/modules/expressions.js index 90099345e..001c3ddb8 100644 --- a/src/application/worker/store/modules/expressions.js +++ b/src/application/worker/store/modules/expressions.js @@ -1,5 +1,5 @@ -import math from "mathjs"; import uuidv4 from "uuid/v4"; +const math = require("mathjs"); const state = { assignments: {} @@ -22,7 +22,7 @@ function compileExpression(expression) { const node = math.parse(expression, scope); newFunction = node.compile(); - newFunction.eval(scope); + newFunction.evaluate(scope); } catch (e) { throw e; } diff --git a/src/application/worker/store/modules/modules.js b/src/application/worker/store/modules/modules.js index e4be765e4..7e326c88e 100644 --- a/src/application/worker/store/modules/modules.js +++ b/src/application/worker/store/modules/modules.js @@ -351,7 +351,7 @@ const actions = { time: Date.now() }; - dataOut = expressionAssignment.func.eval(scope); + dataOut = expressionAssignment.func.evaluate(scope); } if (store.state.dataTypes[type] && store.state.dataTypes[type].create) {