(prop)
| 50 | #endif |
| 51 | |
| 52 | function consumedModuleProp(prop) { |
| 53 | var value = Module[prop]; |
| 54 | var msg = `Attempt to modify \`Module.${prop}\` after it has already been processed. This can happen, for example, when code is injected via '--post-js' rather than '--pre-js'`; |
| 55 | if (Array.isArray(value)) { |
| 56 | value = new Proxy(value, { |
| 57 | set(target, key, val) { |
| 58 | abort(msg); |
| 59 | return false; |
| 60 | }, |
| 61 | defineProperty(target, key, descriptor) { |
| 62 | abort(msg); |
| 63 | return false; |
| 64 | }, |
| 65 | deleteProperty(target, key) { |
| 66 | abort(msg); |
| 67 | return false; |
| 68 | } |
| 69 | }); |
| 70 | } |
| 71 | Object.defineProperty(Module, prop, { |
| 72 | configurable: true, |
| 73 | get() { return value; }, |
| 74 | set() { |
| 75 | abort(msg); |
| 76 | } |
| 77 | }); |
| 78 | } |
| 79 | |
| 80 | function makeInvalidEarlyAccess(name) { |
| 81 | return () => assert(false, `call to '${name}' via reference taken before Wasm module initialization`); |
no outgoing calls
no test coverage detected