{"ScriptPreparationCode":"function mitt(e) {\r\n return {\r\n all: e = e || new Map,\r\n on: function(n, t) {\r\n var f = e.get(n);\r\n f ? f.push(t) : e.set(n, [t])\r\n },\r\n off: function(n, t) {\r\n var f = e.get(n);\r\n f \u0026\u0026 (t ? f.splice(f.indexOf(t) \u003E\u003E\u003E 0, 1) : e.set(n, []))\r\n },\r\n emit: function(n, t) {\r\n var f = e.get(n);\r\n f \u0026\u0026 f.slice().map(function(e) {\r\n e(t)\r\n }), (f = e.get(\u0022*\u0022)) \u0026\u0026 f.slice().map(function(e) {\r\n e(n, t)\r\n })\r\n }\r\n }\r\n}\r\n\r\nvar emitter = mitt()\r\n\r\nemitter.on(\u0022create:dir\u0022, path =\u003E console.log(\u0060Created dir at ${path}\u0060))","TestCases":[{"Name":"Normal","Code":"for ( let i = 0; i \u003C 50; i\u002B\u002B ) {\r\n emitter?.emit(\u0022create:dir\u0022, \u0022/\u0022);\r\n}","IsDeferred":false},{"Name":"Use ?. syntax","Code":"for ( let i = 0; i \u003C 50; i\u002B\u002B ) {\r\n emitter.emit(\u0022create:dir\u0022, \u0022/\u0022);\r\n}","IsDeferred":false}]}