I feel that this is just more elegant/performant than a switch statement, and it's something we do in other places in the codebase. I don't really feel that there is any security risk to worry about, as CSP should mostly protect us. If some app could do bad stuff here, they already have access to the global scope and could do bad stuff there. We can certainly add a conditional to verify the method exists.