MCPcopy
hub / github.com/lebab/lebab / enter

Function enter

src/transform/objMethod.js:20–32  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

18export default function(ast, logger) {
19 traverser.replace(ast, {
20 enter(node) {
21 const match = matchTransformableProperty(node);
22 if (match) {
23 // Do not transform functions with name,
24 // as the name might be recursively referenced from inside.
25 if (match.functionName) {
26 logger.warn(node, 'Unable to transform named function', 'obj-method');
27 return;
28 }
29
30 node.method = true;
31 }
32 }
33 });
34}

Callers

nothing calls this directly

Calls 1

warnMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…