Move function creation out of loop
Move function creation out of loop

Linter complained (it's not actually moved out of it though, function creation still occurs within the loop)

jsdom/whatwg-url,jsdom/whatwg-url,aaronshaf/whatwg-url,jsdom/whatwg-url,tilgovi/whatwg-url