()
| 337 | |
| 338 | @ToolchainProfiler.profile() |
| 339 | def compile_javascript_cached(): |
| 340 | # Avoiding using the cache when generating struct info since |
| 341 | # this step is performed while the cache is locked. |
| 342 | # Sadly we have to skip the caching whenever we have user JS libraries. This is because |
| 343 | # these libraries can import arbitrary other JS files (either vis node's `import` or via #include) |
| 344 | has_user_libs = any(not lib.startswith(utils.path_from_root('src/')) for lib in settings.JS_LIBRARIES) |
| 345 | if DEBUG or settings.BOOTSTRAPPING_STRUCT_INFO or config.FROZEN_CACHE or has_user_libs: |
| 346 | return compile_javascript() |
| 347 | |
| 348 | content_hash = generate_js_compiler_input_hash() |
| 349 | |
| 350 | # Limit of the overall size of the cache. |
| 351 | # This code will get test coverage since a full test run of `other` or `core` |
| 352 | # generates ~1000 unique outputs. |
| 353 | return get_cached_file('js_output', f'{content_hash}.js', compile_javascript, cache_limit=500) |
| 354 | |
| 355 | |
| 356 | def emscript(in_wasm, out_wasm, outfile_js, js_syms, finalize=True, base_metadata=None): |
no test coverage detected