{"ScriptPreparationCode":null,"TestCases":[{"Name":"Native Event listeners","Code":"let i = 1001;\r\nconst results = [];\r\nwhile (--i) {\r\n const index = i;\r\n window.addEventListener(\u0027custom:test\u0027, () =\u003E {\r\n \tresults.push(\u0027Native Event listener \u0027 \u002B index);\r\n }, {once: true});\r\n}\r\n\r\nwindow.dispatchEvent(new CustomEvent(\u0027custom:test\u0027, {bubbles: false}));","IsDeferred":false},{"Name":"Native Event listener with callbacks array","Code":"let i = 1001;\r\nconst callbacks = [];\r\nconst results = [];\r\nwhile (--i) {\r\n const index = i;\r\n callbacks.push(() =\u003E {\r\n \tresults.push(\u0027Fake listeners array \u0027 \u002B index);\r\n });\r\n}\r\n\r\nwindow.addEventListener(\u0027custom:test\u0027, () =\u003E {\r\n results.push(\u0027Native Event listener \u0027 \u002B index);\r\n let i = callbacks.length;\r\n while (--i) callbacks[i]();\r\n}, {once: true});\r\n\r\nwindow.dispatchEvent(new CustomEvent(\u0027custom:test\u0027, {bubbles: false}));","IsDeferred":false},{"Name":"Custom EventTarget","Code":"let i = 1001;\r\nconst target = new EventTarget();\r\nconst results = [];\r\nwhile (--i) {\r\n const index = i;\r\n target.addEventListener(\u0027custom:test\u0027, () =\u003E {\r\n \tresults.push(\u0027Custom EventTarget \u0027 \u002B index);\r\n }, {once: true});\r\n}\r\n\r\ntarget.dispatchEvent(new CustomEvent(\u0027custom:test\u0027, {bubbles: false}));","IsDeferred":false},{"Name":"Custom EventTarget with callbacks array","Code":"let i = 1001;\r\nconst callbacks = [];\r\nconst target = new EventTarget();\r\nconst results = [];\r\nwhile (--i) {\r\n const index = i;\r\n callbacks.push(() =\u003E {\r\n \tresults.push(\u0027Fake listeners array \u0027 \u002B index);\r\n });\r\n}\r\n\r\ntarget.addEventListener(\u0027custom:test\u0027, () =\u003E {\r\n results.push(\u0027Native Event listener \u0027 \u002B index);\r\n let i = callbacks.length;\r\n while (--i) callbacks[i]();\r\n}, {once: true});\r\n\r\ntarget.dispatchEvent(new CustomEvent(\u0027custom:test\u0027, {bubbles: false}));","IsDeferred":false},{"Name":"Fake listeners array","Code":"let i = 1001;\r\nconst callbacks = [];\r\nconst results = [];\r\nwhile (--i) {\r\n const index = i;\r\n callbacks.push(() =\u003E {\r\n \tresults.push(\u0027Fake listeners array \u0027 \u002B index);\r\n });\r\n}\r\n\r\ni = callbacks.length;\r\nwhile (--i) callbacks[i]();","IsDeferred":false}]}