abc
def
ghi
{"ScriptPreparationCode":"var context = document.getElementById(\u0027provider\u0027);\r\nvar element = document.getElementById(\u0027foo\u0027);\r\n\r\nvar SimpleContextEvent = class SimpleContextEvent extends Event {\r\n data = null;\r\n \r\n constructor() {\r\n super(\u0027context-request\u0027, {bubbles: true, composed: true});\r\n }\r\n};\r\n\r\ncontext.addEventListener(\u0027context-request\u0027, event =\u003E {\r\n event.data = \u0027abc\u0027;\r\n event.stopPropagation();\r\n});","TestCases":[{"Name":"closest with element selector","Code":"var i = 5000;\r\nwhile (i--) {\r\n let ctx = element;\r\n ctx = ctx.closest(\u0027context-provider\u0027);\r\n}","IsDeferred":false},{"Name":"while loop \u002B tagName check","Code":"var i = 5000;\r\nwhile (i--) {\r\n let ctx = element;\r\n while (ctx) {\r\n if (ctx.tagName === \u0027CONTEXT-PROVIDER\u0027) {\r\n break;\r\n }\r\n ctx = ctx.parentNode;\r\n }\r\n}","IsDeferred":false},{"Name":"event propagation","Code":"var i = 5000;\r\nwhile (i--) {\r\n let ctxEvent = new SimpleContextEvent();\r\n element.dispatchEvent(ctxEvent);\r\n}","IsDeferred":false}]}