Possible Duplicate:
How does a JavaScript parser work?
How do browsers compile Javascript scripts? What type of compiler it used?
JavaScript isn't compiled, but rather parsed and interpreted. This differs from browser to browser.
Chrome, uses V8, which happens to also be used by node.js. Internet Explorer has a proprietary engine known as Chakra.
As for general rules, the Annotated ES5 shares some insight:
The source text of an ECMAScript program is first converted into a sequence of input elements, which are tokens, line terminators, comments, or white space. The source text is scanned from left to right, repeatedly taking the longest possible sequence of characters as the next input element.