MCPcopy Index your code
hub / github.com/microsoft/vscode-js-debug / functionToFunctionCall

Function functionToFunctionCall

src/common/sourceCodeManipulations.ts:176–184  ·  view source on GitHub ↗
(
  argumentsList: ReadonlyArray<string>,
  functionCode: FunctionExpression | ArrowFunctionExpression,
)

Source from the content-addressed store, hash-verified

174 * function (params) { code } => (function (params) { code })(argumentsText)
175 */
176export const functionToFunctionCall = (
177 argumentsList: ReadonlyArray<string>,
178 functionCode: FunctionExpression | ArrowFunctionExpression,
179): CallExpression => ({
180 type: 'CallExpression',
181 arguments: argumentsList.map(name => ({ type: 'Identifier', name })),
182 callee: functionCode,
183 optional: false,
184});
185
186/**
187 * statement => catchAndReturnErrors(return statement);

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected