ok, you are right.
i brushed over this bit, which makes the critical difference:
write code that's expected to compile and run
for what it's worth, i never had an interview where this was required (except in a coding test, but that was without being watched while i worked on it) and to me it totally does not make sense especially for a whiteboard. making sure every semicolon or brace is in the right place would just be a colossal waste of time.