The HTML parser encounters a script
tag with a source. Code from this source gets loaded from either the network, cache, or an installed service worker. The response is the requested script as a stream of bytes, which the byte stream decoder takes care of! The byte stream decoder decodes the stream of bytes as it’s being downloaded.
The byte stream decoder creates tokens from the decoded stream of bytes. For example, 0066
decodes to f
, 0075
to u
, 006e
to n
, 0063
to c
, 0074
to t
, 0069
to i
, 006...