Finished expr-eval testing
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
edf4518494
commit
3a81441d0b
5 changed files with 260 additions and 132 deletions
|
@ -19,7 +19,7 @@
|
|||
import { Module } from "./common.mjs"
|
||||
import { Parser } from "../lib/expr-eval/parser.mjs"
|
||||
|
||||
const evalVariables = {
|
||||
const EVAL_VARIABLES = {
|
||||
// Variables not provided by expr-eval.js, needs to be provided manually
|
||||
"pi": Math.PI,
|
||||
"PI": Math.PI,
|
||||
|
@ -42,7 +42,7 @@ class ExprParserAPI extends Module {
|
|||
this.currentVars = {}
|
||||
this.#parser = new Parser()
|
||||
|
||||
this.#parser.consts = Object.assign({}, this.#parser.consts, evalVariables)
|
||||
this.#parser.consts = Object.assign({}, this.#parser.consts, EVAL_VARIABLES)
|
||||
|
||||
this.#parser.functions.integral = this.integral.bind(this)
|
||||
this.#parser.functions.derivative = this.derivative.bind(this)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue