So "port to Javascript" isn't going to happen - "port" implies modifying the source code to work on a new platform. Apple isn't going to do that.
An "emulator" however, is very possible. Although a "simulator" is not only easier, but has already happened:
WebSE.
And a full emulator for Amiga is in process:
SAE.
There are three main ways to "emulate" the Mac OS:
The first is a simple
simulator. A simulator is just that - it simulates (pretends) to be the real thing, but isn't at all. That is what WebSE is. It's a site that behaves like a Macintosh, but doesn't have any actual Apple code running, and doesn't run any actual Macintosh software - it is merely a mockup made to look like a Mac.
The second would be a "software emulator". This is a full re-write of the Mac OS to run on other hardware/OSes. It contains no Apple code, but it looks like the Mac OS, and can run Mac OS software.
Executor is a prominent example of this for the classic Mac OS. These have the benefit of being 100% legal, with no copyright or license restrictions from Apple. They are also *VERY* intensive to make - as you have to PERFECTLY emulate the OS itself. (Executor runs a very limited selection of Mac OS applications.)
The third is a "hardware emulator". Rather than emulating the Mac OS itself, it would emulate the Macintosh
hardware. There are lots of these available, the most notable being
Basilisk II and
SheepShaver (for 68k and PPC, respectively.) At their core, they emulate a specific set of hardware, which then can run any OS that hardware could run. The downside (for Macintosh enthusiasts) is that they require an Apple ROM (chip via physical card, or ripped ROM image,) to be run the Mac OS. And that is of questionable legality in many cases. This would be the most "complete" way to do it, but also the most intensive - you're emulating raw hardware, so you can't take advantage of programming shortcuts for specific OS actions.