Well, lighthouse isn’t doing much heavy lifting, but lantern which simulates browser execution is.
I’m not an expert in the architecture behind lighthouse, but my best guess is based on how they simulate browser execution JavaScript made the most sense.