diff --git a/common/src/lib/polyfills/js.mjs b/common/src/lib/polyfills/js.mjs index 9bcf80c..b412716 100644 --- a/common/src/lib/polyfills/js.mjs +++ b/common/src/lib/polyfills/js.mjs @@ -64,10 +64,7 @@ function arrayFlatMap(callbackFn, thisArg) { * @return {String} */ function stringReplaceAll(from, to) { - let str = this - while(str.includes(from)) - str = str.replace(from, to) - return str + return this.split(from).join(to) } diff --git a/common/src/module/latex.mjs b/common/src/module/latex.mjs index 8fabee4..a0e8401 100644 --- a/common/src/module/latex.mjs +++ b/common/src/module/latex.mjs @@ -261,7 +261,7 @@ class LatexAPI extends Module { throw new EvalError("Unknown operator " + item.value + ".") } break - case Instruction.IOP3: // Thirdiary operator + case Instruction.IOP3: // Ternary operator n3 = nstack.pop() n2 = nstack.pop() n1 = nstack.pop()