{"ScriptPreparationCode":"function createObj() {\r\n let value = 0;\r\n return {\r\n value\r\n }\r\n}\r\n\r\nfunction createListeners() {\r\n return Array.from(Array(100), () =\u003E createObj());\r\n}\r\n\r\n\r\nfunction directObservable() {\r\n const lists = [];\r\n return {\r\n addListener: (l) =\u003E lists.push(l),\r\n notify: (v) =\u003E lists.forEach(x =\u003E x.value = v)\r\n };\r\n}\r\n\r\nfunction eventObservable() {\r\n const target = new EventTarget();\r\n\r\n return {\r\n addListener: (l) =\u003E target.addEventListener(\u0027value\u0027, (ev) =\u003E l.value = ev.detail),\r\n notify: (v) =\u003E target.dispatchEvent(new CustomEvent(\u0027value\u0027, {\r\n detail: v\r\n }))\r\n };\r\n}","TestCases":[{"Name":"direct invoke","Code":"const listeners = createListeners();\r\nconst directObs = directObservable();\r\n\r\nlisteners.forEach(x =\u003E directObs.addListener(x));\r\n\r\ndirectObs.notify(1);\r\ndirectObs.notify(2);\r\ndirectObs.notify(3);\r\ndirectObs.notify(1);\r\ndirectObs.notify(2);\r\ndirectObs.notify(3);","IsDeferred":false},{"Name":"event listener","Code":"const listeners = createListeners();\r\nconst eventObs = eventObservable();\r\n\r\nlisteners.forEach(x =\u003E eventObs.addListener(x));\r\n\r\neventObs.notify(1);\r\neventObs.notify(2);\r\neventObs.notify(3);\r\neventObs.notify(1);\r\neventObs.notify(2);\r\neventObs.notify(3);","IsDeferred":false}]}