From 58f29c5026c4cc07e68c1db1a8f5f05c2da0eb81 Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Sun, 13 Jan 2019 10:32:16 -0600 Subject: [PATCH] fix: do not invoke fns returned from math --- src/utils/Math.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/utils/Math.ts b/src/utils/Math.ts index a30fd426d..f65b256c5 100644 --- a/src/utils/Math.ts +++ b/src/utils/Math.ts @@ -37,9 +37,6 @@ export function formatResult(body: unknown, scope: TemplateScope, options: Resul return (body as Date).toString(); case 'Array': return (body as Array).map((it) => formatResult(it, scope, options)).join(options.list.join); - case 'Function': - // TODO: make sure this doesn't allow math to escape the library sandbox - return (body as Function).call(undefined, scope); case 'Object': return JSON.stringify(body); case 'RegExp':