MCPcopy
hub / github.com/webpack/webpack / getImportedGlobals

Function getImportedGlobals

lib/wasm-sync/WebAssemblyGenerator.js:76–89  ·  view source on GitHub ↗
(ast)

Source from the content-addressed store, hash-verified

74 * @returns {t.ModuleImport[]} - nodes
75 */
76const getImportedGlobals = (ast) => {
77 /** @type {t.ModuleImport[]} */
78 const importedGlobals = [];
79
80 t.traverse(ast, {
81 ModuleImport({ node }) {
82 if (t.isGlobalType(node.descr)) {
83 importedGlobals.push(node);
84 }
85 }
86 });
87
88 return importedGlobals;
89};
90
91/**
92 * Get the count for imported func

Callers 1

generateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected