made (a: A).isInstanceOf[B] work sensibly for A <: js.Any and B <: js.Any, checking typeof for primitives, instanceof for non-primitives.