change function syntax

I’m really nitpicking here, but since we’re assigning different
functions to wrap_method() depending on browser support for foreign
objects, it seems more logically coherent to declare a variable and
assign a function as its value, rather than declaring a function
directly using the function keyword. So, a small style change for
consistency, sort of. (Consider this a companion to the previous
commit, the wires got crossed here and the content/messages are
reversed for these two changes.)