Skip to content

Commit

Permalink
fix: do not invoke fns returned from math
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jan 13, 2019
1 parent 1db3782 commit 58f29c5
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/utils/Math.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ export function formatResult(body: unknown, scope: TemplateScope, options: Resul
return (body as Date).toString();
case 'Array':
return (body as Array<unknown>).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':
Expand Down

0 comments on commit 58f29c5

Please sign in to comment.