From 11a65ebdb17834396b60a887bf5b43fc959b49ee Mon Sep 17 00:00:00 2001 From: jos Date: Sat, 2 Feb 2019 18:06:50 +0100 Subject: [PATCH] Remove special case from `allowed factories` --- src/core/function/import.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/function/import.js b/src/core/function/import.js index 9287ac5b7..ea9e55125 100644 --- a/src/core/function/import.js +++ b/src/core/function/import.js @@ -419,8 +419,7 @@ export function importFactory (typed, load, math, factories) { function factoryAllowedInExpressions (factory) { return factory.fn.indexOf('.') === -1 && // FIXME: make checking on path redundant, check on meta data instead !unsafe.hasOwnProperty(factory.fn) && - (!factory.meta || !factory.meta.isClass) && - factory.fn !== 'reviver' // TODO: this is an ugly special case + (!factory.meta || !factory.meta.isClass) } // namespaces and functions not available in the parser for safety reasons @@ -430,7 +429,8 @@ export function importFactory (typed, load, math, factories) { 'docs': true, 'error': true, 'json': true, - 'chain': true // chain method not supported. Note that there is a unit chain too. + 'chain': true, // chain method not supported. Note that there is a unit chain too. + 'reviver': true } return mathImport