IDL: Use switch in union type containers' toV8()

This is a follow-up CL of https://codereview.chromium.org/699713003/.
We can use switch instead of isT() methods.

BUG=240176

Review URL: https://codereview.chromium.org/708903004

git-svn-id: svn://svn.chromium.org/blink/trunk@184947 bbb929c8-8fbe-4397-9dbb-9b2b20218538