MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / visitNode

Function visitNode

tools/transformers/native-class.js:63–102  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

61 };
62
63 function visitNode(node) {
64 if (ts.isBlock(node)) {
65 const [blockStatements, changed] = transformStatements(node.statements, false);
66 if (!changed) {
67 return node;
68 }
69 return factory.updateBlock(node, blockStatements);
70 }
71
72 if (ts.isModuleBlock(node)) {
73 const [moduleStatements, changed] = transformStatements(node.statements, false);
74 if (!changed) {
75 return node;
76 }
77 return factory.updateModuleBlock(node, moduleStatements);
78 }
79
80 if (ts.isCaseClause(node)) {
81 const expression = ts.visitNode(node.expression, visitNode);
82 const [clauseStatements, changed] = transformStatements(node.statements, false);
83 if (expression !== node.expression) {
84 mutated = true;
85 }
86 if (!changed && expression === node.expression) {
87 return node;
88 }
89 return factory.updateCaseClause(node, expression ?? node.expression, clauseStatements);
90 }
91
92 if (ts.isDefaultClause(node)) {
93 const [clauseStatements, changed] = transformStatements(node.statements, false);
94 if (!changed) {
95 return node;
96 }
97 mutated = true;
98 return factory.updateDefaultClause(node, clauseStatements);
99 }
100
101 return ts.visitEachChild(node, visitNode, context);
102 }
103
104 const [updatedStatements] = transformStatements(sourceFile.statements, true);
105 if (!mutated) {

Callers

nothing calls this directly

Calls 1

transformStatementsFunction · 0.70

Tested by

no test coverage detected