MCPcopy Index your code
hub / github.com/codemix/contractual / processFunctionBody

Function processFunctionBody

lib/processor.js:241–254  ·  view source on GitHub ↗

* Process a function body, after labels have been collected. * * @param {Object} ast The `FunctionDeclaration` or `FunctionExpression` to process. * @param {Object} options The options for the processor. * @return {Object} The processed node.

(ast, options)

Source from the content-addressed store, hash-verified

239 * @return {Object} The processed node.
240 */
241function processFunctionBody(ast, options) {
242 OBLIGATIONS.precondition(ast && typeof ast === 'object');
243 OBLIGATIONS.precondition(ast.type === 'FunctionDeclaration' || ast.type === 'FunctionExpression');
244 var __result;
245 __result = estraverse.replace(ast, {
246 enter: function (node) {
247 if (node.type === 'BlockStatement') {
248 return processBlockStatement(node, ast, options);
249 }
250 }
251 });
252 OBLIGATIONS.postcondition(__result && typeof __result === 'object');
253 return __result;
254}
255/**
256 * Process a block statement in a function body, after labels have been collected.
257 *

Callers 1

leaveCollectFunction · 0.70

Calls 1

processBlockStatementFunction · 0.70

Tested by

no test coverage detected