MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / ForStatement

Function ForStatement

tools/acorn-optimizer.mjs:233–239  ·  view source on GitHub ↗
(node, c)

Source from the content-addressed store, hash-verified

231 function cleanUp(ast, names) {
232 recursiveWalk(ast, {
233 ForStatement(node, c) {
234 visitChildren(node, c);
235 // If we had `for (var x = ...; ...)` and we removed `x`, we need to change to `for (; ...)`.
236 if (node.init?.type === 'EmptyStatement') {
237 node.init = null;
238 }
239 },
240 ForInStatement(node, c) {
241 // We can't remove the var in a for-in, as that would result in an invalid syntax. Skip the LHS.
242 c(node.right);

Callers

nothing calls this directly

Calls 1

visitChildrenFunction · 0.85

Tested by

no test coverage detected