* Intercept access to a symbols in the global symbol. This enables us to give * informative warnings/errors when folks attempt to use symbols they did not * include in their build, or no symbols that no longer exist. * * We don't define this in MODULARIZE mode since in that mode emscripten symb
(sym, func)
| 114 | * are never placed in the global scope. |
| 115 | */ |
| 116 | function hookGlobalSymbolAccess(sym, func) { |
| 117 | if (!Object.getOwnPropertyDescriptor(globalThis, sym)) { |
| 118 | Object.defineProperty(globalThis, sym, { |
| 119 | configurable: true, |
| 120 | get() { |
| 121 | func(); |
| 122 | return undefined; |
| 123 | } |
| 124 | }); |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | function missingGlobal(sym, msg) { |
| 129 | hookGlobalSymbolAccess(sym, () => { |
no outgoing calls
no test coverage detected