MCPcopy Create free account
hub / github.com/EmNudge/watlings / trySafeDiv

Function trySafeDiv

tests/015_exceptions.test.js:40–46  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

38
39 // Helper to call safeDiv and catch runtime traps
40 function trySafeDiv(a, b) {
41 try {
42 return { value: safeDiv(a, b), trapped: false };
43 } catch (e) {
44 return { value: null, trapped: true, error: e.message };
45 }
46 }
47
48 const test1 = trySafeDiv(10, 0);
49 assert(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected