workaround dart2js bug in `typeOf` switch with an if / else if / else

https://code.google.com/p/dart/issues/detail?id=11233