I'm guessing the light switch was also a switch for the outlet your computer was plugged into.
A computer being shut down this way can become damaged, it can take one shutdown, it can take 1000 shutdowns. The damage could be minimal and it could be really serious. My PC was power cycled...