diff --git a/src/plugins/expressions/common/executor/executor.ts b/src/plugins/expressions/common/executor/executor.ts index f45f462df17bc..5c27201b43fc0 100644 --- a/src/plugins/expressions/common/executor/executor.ts +++ b/src/plugins/expressions/common/executor/executor.ts @@ -112,6 +112,10 @@ export class Executor = Record { return { ...this.state.get().functions }; } @@ -125,6 +129,10 @@ export class Executor = Record { return { ...this.state.get().types }; } diff --git a/src/plugins/expressions/common/service/expressions_services.ts b/src/plugins/expressions/common/service/expressions_services.ts index 037b997fffb36..8543fbe0fced2 100644 --- a/src/plugins/expressions/common/service/expressions_services.ts +++ b/src/plugins/expressions/common/service/expressions_services.ts @@ -120,17 +120,21 @@ export class ExpressionsService { public setup() { const { executor, renderers, registerFunction, run } = this; + const getFunction = executor.getFunction.bind(executor); const getFunctions = executor.getFunctions.bind(executor); const getRenderer = renderers.get.bind(renderers); const getRenderers = renderers.toJS.bind(renderers); + const getType = executor.getType.bind(executor); const getTypes = executor.getTypes.bind(executor); const registerRenderer = renderers.register.bind(renderers); const registerType = executor.registerType.bind(executor); return { + getFunction, getFunctions, getRenderer, getRenderers, + getType, getTypes, registerFunction, registerRenderer, @@ -142,15 +146,19 @@ export class ExpressionsService { public start() { const { executor, renderers, run } = this; + const getFunction = executor.getFunction.bind(executor); const getFunctions = executor.getFunctions.bind(executor); const getRenderer = renderers.get.bind(renderers); const getRenderers = renderers.toJS.bind(renderers); + const getType = executor.getType.bind(executor); const getTypes = executor.getTypes.bind(executor); return { + getFunction, getFunctions, getRenderer, getRenderers, + getType, getTypes, run, }; diff --git a/src/plugins/expressions/public/plugin.ts b/src/plugins/expressions/public/plugin.ts index f71cf5417062f..6799b1590f252 100644 --- a/src/plugins/expressions/public/plugin.ts +++ b/src/plugins/expressions/public/plugin.ts @@ -140,7 +140,7 @@ export class ExpressionsPublicPlugin // function that matches its definition, but which simply // calls the server-side function endpoint. Object.keys(serverFunctionList).forEach(functionName => { - if (functions.get(functionName)) { + if (expressionsSetup.getFunction(functionName)) { return; } const fn = () => ({