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 callback = null;\r\n \r\n constructor(callback) {\r\n super(\u0027context-request\u0027, {bubbles: true, composed: true});\r\n this.callback = callback;\r\n }\r\n};\r\n\r\ncontext.addEventListener(\u0027context-request\u0027, event =\u003E {\r\n if (event.callback) {\r\n event.callback(context); \r\n } else {\r\n event.data = context;\r\n }\r\n \r\n event.stopPropagation();\r\n});","TestCases":[{"Name":"while loop \u002B tagName check","Code":"var i = 5000;\r\nwhile (i--) {\r\n let ctx = element;\r\n while (ctx \u0026\u0026 ctx.nodeName !== \u0027CONTEXT-PROVIDER\u0027) {\r\n ctx = ctx.assignedSlot || ctx.parentNode || ctx.host;\r\n }\r\n if (ctx !== context) {\r\n throw new Error(\u0027mismatch\u0027);\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 let ctx = ctxEvent.data;\r\n if (ctx !== context) {\r\n throw new Error(\u0027mismatch\u0027);\r\n }\r\n}","IsDeferred":false},{"Name":"event propagation with callback","Code":"var i = 5000;\r\nvar ctx;\r\nvar ctxEvent = new SimpleContextEvent(reply =\u003E {ctx = reply;});\r\n\r\nwhile (i--) {\r\n ctx = null;\r\n element.dispatchEvent(ctxEvent);\r\n if (ctx !== context) {\r\n throw new Error(\u0027mismatch\u0027);\r\n }\r\n}","IsDeferred":false}]}