diff --git a/lib/core/base/check.js b/lib/core/base/check.js index 4f34a5a892..fa3e324c96 100644 --- a/lib/core/base/check.js +++ b/lib/core/base/check.js @@ -1,9 +1,13 @@ -/*global CheckResult,DqElement */ +/*global CheckResult,DqElement, metadataFunctionMap */ function createExecutionContext(spec) { /*eslint no-eval:0 */ 'use strict'; if (typeof spec === 'string') { + if (metadataFunctionMap.has(spec)) { + return metadataFunctionMap.get(spec); + } + return new Function('return ' + spec + ';')(); } return spec; diff --git a/lib/core/base/metadata-function-map.js b/lib/core/base/metadata-function-map.js new file mode 100644 index 0000000000..9d4efd2d6f --- /dev/null +++ b/lib/core/base/metadata-function-map.js @@ -0,0 +1,9 @@ +/*eslint no-unused-vars:0*/ +// TODO: es-modules-checks +// TODO: es-modules-rules +// import all check evaluate and after functions, and all rule matches functions + +const metadataFunctionMap = new Map(); + +// TODO: es-modules-core +// export default metadataFunctionMap;