MCPcopy Create free account
hub / github.com/FastLED/FastLED / _iter_js_affecting_files

Function _iter_js_affecting_files

ci/wasm_build.py:183–212  ·  view source on GitHub ↗

Return files that can change Emscripten-generated JS glue.

()

Source from the content-addressed store, hash-verified

181
182
183def _iter_js_affecting_files() -> list[Path]:
184 """Return files that can change Emscripten-generated JS glue."""
185 files: list[Path] = []
186 src_dir = PROJECT_ROOT / "src"
187 macro_markers = ("EM_JS(", "EM_ASYNC_JS(", "EM_ASM(", "EMSCRIPTEN_BINDINGS(")
188
189 compiler_js = src_dir / "platforms" / "wasm" / "compiler" / "js_library.js"
190 if compiler_js.exists():
191 files.append(compiler_js)
192
193 build_flags = src_dir / "platforms" / "wasm" / "compiler" / "build_flags.toml"
194 if build_flags.exists():
195 files.append(build_flags)
196
197 for path in src_dir.rglob("*"):
198 if not path.is_file():
199 continue
200 if path.suffix not in (".cpp", ".hpp", ".h", ".ipp"):
201 continue
202 if path.name.endswith(".js.cpp.hpp"):
203 files.append(path)
204 continue
205 try:
206 text = path.read_text(encoding="utf-8", errors="ignore")
207 except OSError:
208 continue
209 if any(marker in text for marker in macro_markers):
210 files.append(path)
211
212 return sorted(set(files))
213
214
215def _compute_js_glue_fingerprint() -> str:

Callers 1

Calls 3

anyFunction · 0.85
setClass · 0.50
appendMethod · 0.45

Tested by

no test coverage detected