{"ScriptPreparationCode":"function calculatePrimes(iterations, multiplier) {\r\n var primes = [];\r\n for (var i = 0; i \u003C iterations; i\u002B\u002B) {\r\n var candidate = i * (multiplier * Math.random());\r\n var isPrime = true;\r\n for (var c = 2; c \u003C= Math.sqrt(candidate); \u002B\u002Bc) {\r\n if (candidate % c === 0) {\r\n // not prime\r\n isPrime = false;\r\n break;\r\n }\r\n }\r\n if (isPrime) {\r\n primes.push(candidate);\r\n }\r\n }\r\n return primes;\r\n}","TestCases":[{"Name":"Default Event","Code":"window.bus1 = window.document.createElement(\u0027main\u0027);\r\nwindow.bus1.addEventListener(\u0027test1\u0027, (event) =\u003E {\r\n var primes = calculatePrimes(10, 1000000000);\r\n});\r\n\r\nconst event1 = new CustomEvent(\u0027test1\u0027);\r\nif (window.bus1.dispatchEvent(event1)) {\r\n console.log(\u00271\u0027);\r\n}","IsDeferred":false},{"Name":"Passive Event","Code":"window.bus2 = window.document.createElement(\u0027main\u0027);\r\nwindow.bus2.addEventListener(\u0027test2\u0027, async (event) =\u003E {\r\n new Promise(() =\u003E {\r\n var primes = calculatePrimes(10, 1000000000)\r\n });\r\n}, {passive: true});\r\n\r\nconst event2 = new CustomEvent(\u0027test2\u0027, {\r\n cancelable: false,\r\n});\r\nif (window.bus2.dispatchEvent(event2)) {\r\n console.log(\u00272\u0027);\r\n}","IsDeferred":false}]}