<?xml version='1.0' encoding='utf-8'?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" category="info" consensus="true" docName="draft-ietf-dispatch-javascript-mjs-17" indexInclude="true" ipr="trust200902" number="9239" obsoletes="4329" prepTime="2022-05-06T12:03:19" scripts="Common,Latin" sortRefs="true" submissionType="IETF" symRefs="true" tocDepth="3" tocInclude="true" xml:lang="en">
  <link href="https://datatracker.ietf.org/doc/draft-ietf-dispatch-javascript-mjs-17" rel="prev"/>
  <link href="https://dx.doi.org/10.17487/rfc9239" rel="alternate"/>
  <link href="urn:issn:2070-1721" rel="alternate"/>
  <front>
    <title>Updates to ECMAScript Media Types</title>
    <seriesInfo name="RFC" value="9239" stream="IETF"/>
    <author initials="M." surname="Miller" fullname="Matthew A. Miller">
      <organization showOnFrontPage="true"/>
      <address>
        <email>linuxwolf+ietf@outer-planes.net</email>
      </address>
    </author>
    <author initials="M." surname="Borins" fullname="Myles Borins">
      <organization showOnFrontPage="true">GitHub</organization>
      <address>
        <email>mylesborins@github.com</email>
      </address>
    </author>
    <author initials="M." surname="Bynens" fullname="Mathias Bynens">
      <organization showOnFrontPage="true">Google</organization>
      <address>
        <email>mths@google.com</email>
      </address>
    </author>
    <author initials="B." surname="Farias" fullname="Bradley Farias">
      <organization showOnFrontPage="true"/>
      <address>
        <email>bradley.meck@gmail.com</email>
      </address>
    </author>
    <date month="05" year="2022"/>
    <area>ART</area>
    <workgroup>DISPATCH</workgroup>
    <keyword>JavaScript</keyword>
    <keyword>ECMAScript</keyword>
    <keyword>MIME type</keyword>
    <keyword>Content-Type</keyword>
    <keyword>modules</keyword>
    <keyword>TC39</keyword>
    <keyword>ESM</keyword>
    <abstract pn="section-abstract">
      <t indent="0" pn="section-abstract-1">This document describes the registration of media types for the ECMAScript and JavaScript programming languages and conformance requirements for implementations of these types. This document obsoletes RFC 4329 ("Scripting Media Types)", replacing the previous registrations with information and requirements aligned with common usage and implementation experiences.</t>
    </abstract>
    <note removeInRFC="false" pn="section-note.1">
      <name slugifiedName="name-iesg-note">IESG Note</name>
      <t indent="0" pn="section-note.1-1">This document records the relationship between the work of Ecma 
International's Technical Committee 39 and the media types used to 
identify relevant payloads.</t>
      <t indent="0" pn="section-note.1-2">That relationship was developed outside of the IETF and as a result is 
unfortunately not aligned with the best practices of BCP 13.  
Consequently, consensus exists in the IETF to document the relationship 
and update the relevant IANA registrations for those media types, but 
this is not an IETF endorsement of the media types chosen for this work.</t>
    </note>
    <boilerplate>
      <section anchor="status-of-memo" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.1">
        <name slugifiedName="name-status-of-this-memo">Status of This Memo</name>
        <t indent="0" pn="section-boilerplate.1-1">
            This document is not an Internet Standards Track specification; it is
            published for informational purposes.  
        </t>
        <t indent="0" pn="section-boilerplate.1-2">
            This document is a product of the Internet Engineering Task Force
            (IETF).  It represents the consensus of the IETF community.  It has
            received public review and has been approved for publication by the
            Internet Engineering Steering Group (IESG).  Not all documents
            approved by the IESG are candidates for any level of Internet
            Standard; see Section 2 of RFC 7841. 
        </t>
        <t indent="0" pn="section-boilerplate.1-3">
            Information about the current status of this document, any
            errata, and how to provide feedback on it may be obtained at
            <eref target="https://www.rfc-editor.org/info/rfc9239" brackets="none"/>.
        </t>
      </section>
      <section anchor="copyright" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.2">
        <name slugifiedName="name-copyright-notice">Copyright Notice</name>
        <t indent="0" pn="section-boilerplate.2-1">
            Copyright (c) 2022 IETF Trust and the persons identified as the
            document authors. All rights reserved.
        </t>
        <t indent="0" pn="section-boilerplate.2-2">
            This document is subject to BCP 78 and the IETF Trust's Legal
            Provisions Relating to IETF Documents
            (<eref target="https://trustee.ietf.org/license-info" brackets="none"/>) in effect on the date of
            publication of this document. Please review these documents
            carefully, as they describe your rights and restrictions with
            respect to this document. Code Components extracted from this
            document must include Revised BSD License text as described in
            Section 4.e of the Trust Legal Provisions and are provided without
            warranty as described in the Revised BSD License.
        </t>
      </section>
    </boilerplate>
    <toc>
      <section anchor="toc" numbered="false" removeInRFC="false" toc="exclude" pn="section-toc.1">
        <name slugifiedName="name-table-of-contents">Table of Contents</name>
        <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1">
          <li pn="section-toc.1-1.1">
            <t indent="0" keepWithNext="true" pn="section-toc.1-1.1.1"><xref derivedContent="1" format="counter" sectionFormat="of" target="section-1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-introduction">Introduction</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.1.2">
              <li pn="section-toc.1-1.1.2.1">
                <t indent="0" keepWithNext="true" pn="section-toc.1-1.1.2.1.1"><xref derivedContent="1.1" format="counter" sectionFormat="of" target="section-1.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-terminology">Terminology</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.2">
            <t indent="0" keepWithNext="true" pn="section-toc.1-1.2.1"><xref derivedContent="2" format="counter" sectionFormat="of" target="section-2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-compatibility">Compatibility</xref></t>
          </li>
          <li pn="section-toc.1-1.3">
            <t indent="0" pn="section-toc.1-1.3.1"><xref derivedContent="3" format="counter" sectionFormat="of" target="section-3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-modules">Modules</xref></t>
          </li>
          <li pn="section-toc.1-1.4">
            <t indent="0" pn="section-toc.1-1.4.1"><xref derivedContent="4" format="counter" sectionFormat="of" target="section-4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-encoding">Encoding</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.4.2">
              <li pn="section-toc.1-1.4.2.1">
                <t indent="0" pn="section-toc.1-1.4.2.1.1"><xref derivedContent="4.1" format="counter" sectionFormat="of" target="section-4.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-charset-parameter">Charset Parameter</xref></t>
              </li>
              <li pn="section-toc.1-1.4.2.2">
                <t indent="0" pn="section-toc.1-1.4.2.2.1"><xref derivedContent="4.2" format="counter" sectionFormat="of" target="section-4.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-character-encoding-scheme-d">Character Encoding Scheme Detection</xref></t>
              </li>
              <li pn="section-toc.1-1.4.2.3">
                <t indent="0" pn="section-toc.1-1.4.2.3.1"><xref derivedContent="4.3" format="counter" sectionFormat="of" target="section-4.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-character-encoding-scheme-e">Character Encoding Scheme Error Handling</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.5">
            <t indent="0" pn="section-toc.1-1.5.1"><xref derivedContent="5" format="counter" sectionFormat="of" target="section-5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-security-considerations">Security Considerations</xref></t>
          </li>
          <li pn="section-toc.1-1.6">
            <t indent="0" pn="section-toc.1-1.6.1"><xref derivedContent="6" format="counter" sectionFormat="of" target="section-6"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-iana-considerations">IANA Considerations</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.6.2">
              <li pn="section-toc.1-1.6.2.1">
                <t indent="0" pn="section-toc.1-1.6.2.1.1"><xref derivedContent="6.1" format="counter" sectionFormat="of" target="section-6.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-common-javascript-media-typ">Common JavaScript Media Types</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.6.2.1.2">
                  <li pn="section-toc.1-1.6.2.1.2.1">
                    <t indent="0" pn="section-toc.1-1.6.2.1.2.1.1"><xref derivedContent="6.1.1" format="counter" sectionFormat="of" target="section-6.1.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-text-javascript">text/javascript</xref></t>
                  </li>
                </ul>
              </li>
              <li pn="section-toc.1-1.6.2.2">
                <t indent="0" pn="section-toc.1-1.6.2.2.1"><xref derivedContent="6.2" format="counter" sectionFormat="of" target="section-6.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-historic-javascript-media-t">Historic JavaScript Media Types</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.6.2.2.2">
                  <li pn="section-toc.1-1.6.2.2.2.1">
                    <t indent="0" pn="section-toc.1-1.6.2.2.2.1.1"><xref derivedContent="6.2.1" format="counter" sectionFormat="of" target="section-6.2.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-text-ecmascript">text/ecmascript</xref></t>
                  </li>
                </ul>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.7">
            <t indent="0" pn="section-toc.1-1.7.1"><xref derivedContent="7" format="counter" sectionFormat="of" target="section-7"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-references">References</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.7.2">
              <li pn="section-toc.1-1.7.2.1">
                <t indent="0" pn="section-toc.1-1.7.2.1.1"><xref derivedContent="7.1" format="counter" sectionFormat="of" target="section-7.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-normative-references">Normative References</xref></t>
              </li>
              <li pn="section-toc.1-1.7.2.2">
                <t indent="0" pn="section-toc.1-1.7.2.2.1"><xref derivedContent="7.2" format="counter" sectionFormat="of" target="section-7.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-informative-references">Informative References</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.8">
            <t indent="0" pn="section-toc.1-1.8.1"><xref derivedContent="Appendix A" format="default" sectionFormat="of" target="section-appendix.a"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-changes-from-rfc-4329">Changes from RFC 4329</xref></t>
          </li>
          <li pn="section-toc.1-1.9">
            <t indent="0" pn="section-toc.1-1.9.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.b"/><xref derivedContent="" format="title" sectionFormat="of" target="name-acknowledgements">Acknowledgements</xref></t>
          </li>
          <li pn="section-toc.1-1.10">
            <t indent="0" pn="section-toc.1-1.10.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.c"/><xref derivedContent="" format="title" sectionFormat="of" target="name-authors-addresses">Authors' Addresses</xref></t>
          </li>
        </ul>
      </section>
    </toc>
  </front>
  <middle>
    <section anchor="introduction" numbered="true" toc="include" removeInRFC="false" pn="section-1">
      <name slugifiedName="name-introduction">Introduction</name>
      <t indent="0" pn="section-1-1">This memo describes media types for the JavaScript and ECMAScript programming languages.  Refer to the sections "Introduction" and "Overview" in <xref target="ECMA-262" format="default" sectionFormat="of" derivedContent="ECMA-262"/> for background information on these languages.  This document updates the descriptions and registrations for these media types to reflect existing usage on the Internet, and it provides up-to-date security considerations.</t>
      <t indent="0" pn="section-1-2">This document replaces the media type registrations in <xref target="RFC4329" format="default" sectionFormat="of" derivedContent="RFC4329"/> and updates the requirements for implementations using those media types defined in <xref target="RFC4329" format="default" sectionFormat="of" derivedContent="RFC4329"/> based on current existing practices. As a consequence, this document obsoletes <xref target="RFC4329" format="default" sectionFormat="of" derivedContent="RFC4329"/>.</t>
      <section anchor="terminology" numbered="true" toc="include" removeInRFC="false" pn="section-1.1">
        <name slugifiedName="name-terminology">Terminology</name>
        <t indent="0" pn="section-1.1-1">The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>",
"<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>",
"<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>",
"<bcp14>SHOULD NOT</bcp14>",
"<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document
are to be interpreted as described in BCP 14
<xref target="RFC2119" format="default" sectionFormat="of" derivedContent="RFC2119"/> <xref target="RFC8174" format="default" sectionFormat="of" derivedContent="RFC8174"/> when, and only
when, they appear in all capitals, as shown here.</t>
      </section>
    </section>
    <section anchor="compatibility" numbered="true" toc="include" removeInRFC="false" pn="section-2">
      <name slugifiedName="name-compatibility">Compatibility</name>
      <t indent="0" pn="section-2-1">This document defines equivalent processing requirements for the 
various script media types.  The most widely supported media type in use is text/javascript; all others are considered historical and obsolete aliases of text/javascript.</t>
      <t indent="0" pn="section-2-2">The types defined in this document are applicable to scripts written in <xref target="ECMA-262" format="default" sectionFormat="of" derivedContent="ECMA-262"/>. New editions of <xref target="ECMA-262" format="default" sectionFormat="of" derivedContent="ECMA-262"/> are subjected to strong obligations of backward compatibility, imposed by the standardization process of Ecma International's Technical Committee 39 (TC39). As a result, JavaScript code based on an earlier edition is generally compatible with a JavaScript engine adhering to a later edition. The few exceptions to this are documented in <xref target="ECMA-262" format="default" sectionFormat="of" derivedContent="ECMA-262"/> in the section "Additions and Changes That Introduce Incompatibilities with Prior Editions". JavaScript developers commonly use feature detection to ensure that modern JavaScript features are only used when available in the current environment. Later editions of <xref target="ECMA-262" format="default" sectionFormat="of" derivedContent="ECMA-262"/> are not directly addressed in this document, although it is expected that implementations will behave as if applicability were extended to them. This document does not address other extensions to <xref target="ECMA-262" format="default" sectionFormat="of" derivedContent="ECMA-262"/> or scripts written in other languages.</t>
      <t indent="0" pn="section-2-3">This document may be updated to take other content into account.  Updates of this document may introduce new optional parameters; implementations must consider the impact of such an update.</t>
      <t indent="0" pn="section-2-4">This document does not define how fragment identifiers in resource identifiers <xref target="RFC3986" format="default" sectionFormat="of" derivedContent="RFC3986"/> <xref target="RFC3987" format="default" sectionFormat="of" derivedContent="RFC3987"/> for documents labeled with one of the media types defined in this document are resolved.  An update of this document may define processing of fragment identifiers.</t>
      <t indent="0" pn="section-2-5">Note that this use of the "text" media type tree willfully does not align with its original intent per <xref target="RFC2045" format="default" sectionFormat="of" derivedContent="RFC2045"/>. The reason for this is historical. <xref target="RFC4329" format="default" sectionFormat="of" derivedContent="RFC4329"/> registered both the text/* and application/* types, marking the text/* types obsolete. This was done to encourage people toward application/*, matching the guidance in <xref target="RFC4288" format="default" sectionFormat="of" derivedContent="RFC4288"/>, the predecessor to <xref target="RFC6838" format="default" sectionFormat="of" derivedContent="RFC6838"/>. Since then, however, the industry widely adopted text/* anyway. The definitions in this document reflect the current state of implementation across the JavaScript ecosystem, in web browsers and other environments such as Node.js alike, in order to guarantee backward compatibility with existing applications as much as possible. Future registrations should not view this as a repeatable precedent.</t>
    </section>
    <section anchor="modules" numbered="true" toc="include" removeInRFC="false" pn="section-3">
      <name slugifiedName="name-modules">Modules</name>
      <t indent="0" pn="section-3-1">In order to formalize support for modular programs, <xref target="ECMA-262" format="default" sectionFormat="of" derivedContent="ECMA-262"/> (starting with the 6th Edition) defines two top-level goal symbols (or roots to the abstract syntax tree) for the ECMAScript grammar: Module and Script.  The Script goal represents the original structure where the code executes in the global scope, while the Module goal represents the module system built into ECMAScript starting with the 6th Edition.  See the section "ECMAScript Language: Scripts and Modules" in <xref target="ECMA-262" format="default" sectionFormat="of" derivedContent="ECMA-262"/> for details.</t>
      <t indent="0" pn="section-3-2">This separation means that (in the absence of additional information) there are two possible interpretations for any given ECMAScript source text.</t>
      <t indent="0" pn="section-3-3">Ecma International's Technical Committee 39 (TC39), the standards body in charge of ECMAScript, has determined that media types are outside of their scope of work <xref target="TC39-MIME-ISSUE" format="default" sectionFormat="of" derivedContent="TC39-MIME-ISSUE"/>.</t>
      <t indent="0" pn="section-3-4">It is not possible to fully determine if a source text of ECMAScript is meant to be parsed using the Module or Script grammar goals based upon content or media type alone. Therefore, as permitted by the media types in this document, scripting environments use out-of-band information in order to determine what goal should be used. Some scripting environments have chosen to adopt the file extension of .mjs for this purpose.</t>
    </section>
    <section anchor="encoding" numbered="true" toc="include" removeInRFC="false" pn="section-4">
      <name slugifiedName="name-encoding">Encoding</name>
      <t indent="0" pn="section-4-1">Refer to <xref target="RFC6365" format="default" sectionFormat="of" derivedContent="RFC6365"/> for a discussion of terminology used in this section.  Source text (as defined in the section "Source Text" in <xref target="ECMA-262" format="default" sectionFormat="of" derivedContent="ECMA-262"/>) can be binary source text.  Binary source text is a textual data object that represents source text encoded using a character encoding scheme.  A textual data object is a whole text protocol message or a whole text document, or a part of it, that is treated separately for purposes of external storage and retrieval.  An implementation's internal representation of source text is not considered binary source text.</t>
      <t indent="0" pn="section-4-2">Implementations need to determine a character encoding scheme in order to decode binary source text to source text.  The media types defined in this document allow an optional charset parameter to explicitly specify the character encoding scheme used to encode the source text.</t>
      <t indent="0" pn="section-4-3">In order to ensure interoperability and align with widespread implementation practices, the charset parameter is optional rather than required, despite the recommendation in <xref target="RFC6838" format="default" sectionFormat="of" derivedContent="RFC6838">BCP 13</xref> for text/* types.</t>
      <t indent="0" pn="section-4-4">How implementations determine the character encoding scheme can be subject to processing rules that are out of the scope of this document.  For example, transport protocols can require that a specific character encoding scheme is to be assumed if the optional charset parameter is not specified, or they can require that the charset parameter is used in certain cases.  Such requirements are not defined by this document.</t>
      <t indent="0" pn="section-4-5">Implementations that support binary source text <bcp14>MUST</bcp14> support binary source text encoded using the UTF-8 <xref target="RFC3629" format="default" sectionFormat="of" derivedContent="RFC3629"/> character encoding scheme.  Module goal sources <bcp14>MUST</bcp14> be encoded as UTF-8; all other encodings will fail.  Source goal sources <bcp14>SHOULD</bcp14> be encoded as UTF-8; other character encoding schemes <bcp14>MAY</bcp14> be supported but are discouraged.  Whether U+FEFF is processed as a Byte Order Mark (BOM) signature or not depends on the host environment and is not defined by this document.</t>
      <section anchor="charset-parameter" numbered="true" toc="include" removeInRFC="false" pn="section-4.1">
        <name slugifiedName="name-charset-parameter">Charset Parameter</name>
        <t indent="0" pn="section-4.1-1">The charset parameter provides a means to specify the character encoding scheme of binary source text.  If present, the value of the charset parameter <bcp14>MUST</bcp14> be a registered charset <xref target="CHARSETS" format="default" sectionFormat="of" derivedContent="CHARSETS"/> and is considered valid if it matches the mime-charset production defined in <xref target="RFC2978" sectionFormat="of" section="2.3" format="default" derivedLink="https://rfc-editor.org/rfc/rfc2978#section-2.3" derivedContent="RFC2978"/>.</t>
        <t indent="0" pn="section-4.1-2">The charset parameter is only used when processing a Script goal source; Module goal sources <bcp14>MUST</bcp14> always be processed as UTF-8.</t>
      </section>
      <section anchor="character-encoding-scheme-detection" numbered="true" toc="include" removeInRFC="false" pn="section-4.2">
        <name slugifiedName="name-character-encoding-scheme-d">Character Encoding Scheme Detection</name>
        <t indent="0" pn="section-4.2-1">It is possible that implementations cannot interoperably determine a single character encoding scheme simply by complying with all requirements of the applicable specifications.  To foster interoperability in such cases, the following algorithm is defined.  Implementations apply this algorithm until a single character encoding scheme is determined.</t>
        <ol spacing="normal" type="1" indent="adaptive" start="1" pn="section-4.2-2"><li pn="section-4.2-2.1" derivedCounter="1.">
            <t indent="0" pn="section-4.2-2.1.1">If the binary source text is not already determined to be using a Module goal and starts with a Unicode encoding form signature, the signature determines the encoding.  The following octet sequences, at the very beginning of the binary source text, are considered with their corresponding character encoding schemes:  </t>
            <table align="left" anchor="tab" pn="table-1">
              <name/>
              <thead>
                <tr>
                  <th align="left" colspan="1" rowspan="1">Leading sequence</th>
                  <th align="left" colspan="1" rowspan="1">Encoding</th>
                </tr>
              </thead>
              <tbody>
                <tr>
                  <td align="left" colspan="1" rowspan="1">EF BB BF</td>
                  <td align="left" colspan="1" rowspan="1">UTF-8</td>
                </tr>
                <tr>
                  <td align="left" colspan="1" rowspan="1">FF FE</td>
                  <td align="left" colspan="1" rowspan="1">UTF-16LE</td>
                </tr>
                <tr>
                  <td align="left" colspan="1" rowspan="1">FE FF</td>
                  <td align="left" colspan="1" rowspan="1">UTF-16BE</td>
                </tr>
              </tbody>
            </table>
            <t indent="0" pn="section-4.2-2.1.3">
Implementations of this step <bcp14>MUST</bcp14> use these octet sequences to determine the character encoding scheme, even if the determined scheme is not supported.  If this step determines the character encoding scheme, the octet sequence representing the Unicode encoding form signature <bcp14>MUST</bcp14> be ignored when decoding the binary source text.</t>
          </li>
          <li pn="section-4.2-2.2" derivedCounter="2.">Else, if a charset parameter is specified and its value is valid and supported by the implementation, the value determines the character encoding scheme.</li>
          <li pn="section-4.2-2.3" derivedCounter="3.">Else, the character encoding scheme is assumed to be UTF-8.</li>
        </ol>
        <t indent="0" pn="section-4.2-3">If the character encoding scheme is determined to be UTF-8 through any means other than step 1 as defined above and the binary source text starts with the octet sequence EF BB BF, the octet sequence is ignored when decoding the binary source text.</t>
      </section>
      <section anchor="character-encoding-scheme-error-handling" numbered="true" toc="include" removeInRFC="false" pn="section-4.3">
        <name slugifiedName="name-character-encoding-scheme-e">Character Encoding Scheme Error Handling</name>
        <t indent="0" pn="section-4.3-1">Binary source text that is not properly encoded for the determined character encoding can pose a security risk, as discussed in <xref target="security-considerations" format="default" sectionFormat="of" derivedContent="Section 5"/>.  That said, because of the varied and complex environments scripts are executed in, most of the error handling specifics are left to the processors.  The following are broad guidelines that processors follow.</t>
        <t indent="0" pn="section-4.3-2">If binary source text is determined to have been encoded using a certain character encoding scheme that the implementation is unable to process, implementations can consider the resource unsupported (i.e., do not decode the binary source text using a different character encoding scheme).</t>
        <t indent="0" pn="section-4.3-3">Binary source text can be determined to have been encoded using a certain character encoding scheme but contain octet sequences that are not valid according to that scheme.  Implementations can substitute those invalid sequences with the replacement character U+FFFD (properly encoded for the scheme) or stop processing altogether.</t>
      </section>
    </section>
    <section anchor="security-considerations" numbered="true" toc="include" removeInRFC="false" pn="section-5">
      <name slugifiedName="name-security-considerations">Security Considerations</name>
      <t indent="0" pn="section-5-1">Refer to <xref target="RFC3552" format="default" sectionFormat="of" derivedContent="RFC3552"/> for a discussion of terminology used in this section.  Examples in this section and discussions of interactions of host environments with scripts, modules, and extensions to <xref target="ECMA-262" format="default" sectionFormat="of" derivedContent="ECMA-262"/> are to be understood as non-exhaustive and of a purely illustrative nature.</t>
      <t indent="0" pn="section-5-2">The programming language defined in <xref target="ECMA-262" format="default" sectionFormat="of" derivedContent="ECMA-262"/> is not intended to be computationally self-sufficient; rather, it is expected that the computational environment provides facilities to programs to enable specific functionality.  Such facilities constitute unknown factors and are thus not defined by this document.</t>
      <t indent="0" pn="section-5-3">Derived programming languages are permitted to include additional functionality that is not described in <xref target="ECMA-262" format="default" sectionFormat="of" derivedContent="ECMA-262"/>; such functionality constitutes an unknown factor and is thus not defined by this document.  In particular, extensions to <xref target="ECMA-262" format="default" sectionFormat="of" derivedContent="ECMA-262"/> defined for the JavaScript programming language are not discussed in this document.</t>
      <t indent="0" pn="section-5-4">Uncontrolled execution of scripts can be exceedingly dangerous. Implementations that execute scripts <bcp14>MUST</bcp14> give consideration to their application's threat models and those of the individual features they implement; in particular, they <bcp14>MUST</bcp14> ensure that untrusted content is not executed in an unprotected environment.</t>
      <t indent="0" pn="section-5-5">Module scripts in ECMAScript can request the fetching and processing of additional scripts; this is called "importing". Implementations that support modules need to process imported sources in the same way as scripts. See the section "ECMAScript Language: Scripts and Modules" in <xref target="ECMA-262" format="default" sectionFormat="of" derivedContent="ECMA-262"/> for details. Further, there may be additional privacy and security concerns, depending on the location(s) the original script and its imported modules are obtained from. For instance, a script obtained from "host-a.example" could request to import a script from "host-b.example", which could expose information about the executing environment (e.g., IP address) to "host-b.example".</t>
      <t indent="0" pn="section-5-6">Specifications for host environment facilities and for derived programming languages should include security considerations.  If an implementation supports such facilities, the respective security considerations apply.  In particular, if scripts can be referenced from or included in specific document formats, the considerations for the embedding or referencing document format apply.</t>
      <t indent="0" pn="section-5-7">For example, scripts embedded in application/xhtml+xml <xref target="RFC3236" format="default" sectionFormat="of" derivedContent="RFC3236"/> documents could be enabled through the host environment to manipulate the document instance, which could cause the retrieval of remote resources; security considerations regarding retrieval of remote resources of the embedding document would apply in this case.</t>
      <t indent="0" pn="section-5-8">This circumstance can further be used to make information that is normally only available to the script also available to a web server by encoding the information in the resource identifier of the resource, which can further enable eavesdropping attacks.  Implementation of such facilities is subject to the security considerations of the host environment, as discussed above.</t>
      <t indent="0" pn="section-5-9">The programming language defined in <xref target="ECMA-262" format="default" sectionFormat="of" derivedContent="ECMA-262"/> does include facilities to loop, cause computationally complex operations, or consume large amounts of memory; this includes, but is not limited to, facilities that allow dynamically generated source text to be executed (e.g., the eval() function); uncontrolled execution of such features can cause denial of service, which implementations <bcp14>MUST</bcp14> protect against.</t>
      <t indent="0" pn="section-5-10">With the addition of SharedArrayBuffer objects in ECMAScript version 8, it could be possible to implement a high-resolution timer, which could lead to certain types of timing and side-channel attacks (e.g., <xref target="SPECTRE" format="default" sectionFormat="of" derivedContent="SPECTRE"/>).  Implementations can take steps to mitigate this concern, such as disabling or removing support for SharedArrayBuffer objects, or can take additional steps to ensure that this shared memory is only accessible between execution contexts that have some form of mutual trust.</t>
      <t indent="0" pn="section-5-11">A host environment can provide facilities to access external input. Scripts that pass such input to the eval() function or similar language features can be vulnerable to code injection attacks. Scripts are expected to protect against such attacks.</t>
      <t indent="0" pn="section-5-12">A host environment can provide facilities to output computed results in a user-visible manner.  For example, host environments supporting a graphical user interface can provide facilities that enable scripts to present certain messages to the user.  Implementations <bcp14>MUST</bcp14> take steps to avoid confusion of the origin of such messages.  In general, the security considerations for the host environment apply in such a case as discussed above.</t>
      <t indent="0" pn="section-5-13">Implementations are required to support the UTF-8 character encoding scheme; the security considerations of <xref target="RFC3629" format="default" sectionFormat="of" derivedContent="RFC3629"/> apply.  Additional character encoding schemes may be supported; support for such schemes is subject to the security considerations of those schemes.</t>
      <t indent="0" pn="section-5-14">Source text is expected to be in Unicode Normalization Form C. Scripts and implementations <bcp14>MUST</bcp14> consider security implications of unnormalized source text and data.  For a detailed discussion of such implications, refer to the security considerations in <xref target="RFC3629" format="default" sectionFormat="of" derivedContent="RFC3629"/>.</t>
      <t indent="0" pn="section-5-15">Scripts can be executed in an environment that is vulnerable to code injection attacks.  For example, a Common Gateway Interface (CGI) script <xref target="RFC3875" format="default" sectionFormat="of" derivedContent="RFC3875"/> echoing user input could allow the inclusion of untrusted scripts that could be executed in an otherwise trusted environment.  This threat scenario is subject to security considerations that are out of the scope of this document.</t>
      <t indent="0" pn="section-5-16">The "data" resource identifier scheme <xref target="RFC2397" format="default" sectionFormat="of" derivedContent="RFC2397"/>, in combination with the types defined in this document, could be used to cause execution of untrusted scripts through the inclusion of untrusted resource identifiers in otherwise trusted content.  Security considerations of <xref target="RFC2397" format="default" sectionFormat="of" derivedContent="RFC2397"/> apply.</t>
      <t indent="0" pn="section-5-17">Implementations can fail to implement a specific security model or other means to prevent possibly dangerous operations.  Such failure could possibly be exploited to gain unauthorized access to a system or sensitive information; such failure constitutes an unknown factor and is thus not defined by this document.</t>
    </section>
    <section anchor="iana-considerations" numbered="true" toc="include" removeInRFC="false" pn="section-6">
      <name slugifiedName="name-iana-considerations">IANA Considerations</name>
      <t indent="0" pn="section-6-1">The media type registrations herein are divided into two major categories: (1) the sole media type "text/javascript", which is now in common usage and (2) all of the media types that are obsolete (i.e., "application/ecmascript", "application/javascript", "application/x-ecmascript", "application/x-javascript", "text/ecmascript", "text/javascript1.0", "text/javascript1.1", "text/javascript1.2", "text/javascript1.3", "text/javascript1.4", "text/javascript1.5", "text/jscript", "text/livescript", and "text/x-ecmascript").</t>
      <t indent="0" pn="section-6-2">For both categories, the "Published specification" entry for the media types is updated to reference <xref target="ECMA-262" format="default" sectionFormat="of" derivedContent="ECMA-262"/>. In addition, a new file extension of .mjs has been added to the list of file extensions with the restriction that contents should be parsed using the Module goal. Finally, the <xref target="HTML" format="default" sectionFormat="of" derivedContent="HTML"/> specification uses "text/javascript" as the default media type of ECMAScript when preparing script tags; therefore, "text/javascript" intended usage has been moved from OBSOLETE to COMMON.</t>
      <t indent="0" pn="section-6-3">These changes have been reflected in the IANA "Media Types" registry in accordance with <xref target="RFC6838" format="default" sectionFormat="of" derivedContent="RFC6838"/>. All registrations will point to this document as the reference. The outdated note stating that the "text/javascript" media type has been "OBSOLETED in favor of application/javascript" has been removed. The outdated note stating that the "text/ecmascript" media type has been "OBSOLETED in favor of application/ecmascript" has been removed. IANA has added the note "OBSOLETED in favor of text/javascript" to all registrations except "text/javascript"; that is, this note has been added to the "text/ecmascript", "application/javascript", and "application/ecmascript" registrations.</t>
      <t indent="0" pn="section-6-4">Four of the legacy media types in this document have a subtype starting with the "x-" prefix:</t>
      <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-6-5">
        <li pn="section-6-5.1">application/x-ecmascript</li>
        <li pn="section-6-5.2">application/x-javascript</li>
        <li pn="section-6-5.3">text/x-ecmascript</li>
        <li pn="section-6-5.4">text/x-javascript</li>
      </ul>
      <t indent="0" pn="section-6-6">Note that these are grandfathered media types registered as per <xref target="RFC6838" sectionFormat="of" section="A" format="default" derivedLink="https://rfc-editor.org/rfc/rfc6838#appendix-A" derivedContent="RFC6838"/>. These registrations predate <xref target="RFC6648" format="default" sectionFormat="of" derivedContent="RFC6648">BCP 178</xref>, which they violate, and are only included in this document for backward compatibility.</t>
      <section anchor="common-javascript-media-types" numbered="true" toc="include" removeInRFC="false" pn="section-6.1">
        <name slugifiedName="name-common-javascript-media-typ">Common JavaScript Media Types</name>
        <section anchor="textjavascript" numbered="true" toc="include" removeInRFC="false" pn="section-6.1.1">
          <name slugifiedName="name-text-javascript">text/javascript</name>
          <dl newline="false" spacing="normal" indent="3" pn="section-6.1.1-1">
            <dt pn="section-6.1.1-1.1">
Type name:  </dt>
            <dd pn="section-6.1.1-1.2">
              text
            </dd>
            <dt pn="section-6.1.1-1.3">
Subtype name:  </dt>
            <dd pn="section-6.1.1-1.4">
              javascript
            </dd>
            <dt pn="section-6.1.1-1.5">
Required parameters:  </dt>
            <dd pn="section-6.1.1-1.6">
              N/A
            </dd>
            <dt pn="section-6.1.1-1.7">
Optional parameters:  </dt>
            <dd pn="section-6.1.1-1.8">
              charset. See <xref target="charset-parameter" format="default" sectionFormat="of" derivedContent="Section 4.1"/> of RFC 9239.
            </dd>
            <dt pn="section-6.1.1-1.9">
Encoding considerations:  </dt>
            <dd pn="section-6.1.1-1.10">
              Binary
            </dd>
            <dt pn="section-6.1.1-1.11">
Security considerations:  </dt>
            <dd pn="section-6.1.1-1.12">
              See <xref target="security-considerations" format="default" sectionFormat="of" derivedContent="Section 5"/> of RFC 9239.
            </dd>
            <dt pn="section-6.1.1-1.13">
Interoperability considerations:  </dt>
            <dd pn="section-6.1.1-1.14">
              It is expected that implementations will behave as if this registration applies to later editions of <xref target="ECMA-262" format="default" sectionFormat="of" derivedContent="ECMA-262"/>, and its published specification references may be updated accordingly from time to time. Although this expectation is unusual among media type registrations, it matches widespread industry conventions. See <xref target="compatibility" format="default" sectionFormat="of" derivedContent="Section 2"/> of RFC 9239.
            </dd>
            <dt pn="section-6.1.1-1.15">
Published specification:  </dt>
            <dd pn="section-6.1.1-1.16">
              <xref target="ECMA-262" format="default" sectionFormat="of" derivedContent="ECMA-262"/>
            </dd>
            <dt pn="section-6.1.1-1.17">
Applications that use this media type:  </dt>
            <dd pn="section-6.1.1-1.18">
              Script interpreters as discussed in RFC 9239.
            </dd>
          </dl>
          <dl newline="true" spacing="normal" indent="3" pn="section-6.1.1-2">
            <dt pn="section-6.1.1-2.1">Additional information:</dt>
            <dd pn="section-6.1.1-2.2">
              <dl newline="false" spacing="compact" indent="3" pn="section-6.1.1-2.2.1">
                <dt pn="section-6.1.1-2.2.1.1">
Deprecated alias names for this type:  </dt>
                <dd pn="section-6.1.1-2.2.1.2">
              application/javascript, application/x-javascript, text/javascript1.0, text/javascript1.1, text/javascript1.2, text/javascript1.3, text/javascript1.4, text/javascript1.5, text/jscript, text/livescript
            </dd>
                <dt pn="section-6.1.1-2.2.1.3">
Magic number(s):      </dt>
                <dd pn="section-6.1.1-2.2.1.4">
                  N/A
                </dd>
                <dt pn="section-6.1.1-2.2.1.5">
File extension(s):      </dt>
                <dd pn="section-6.1.1-2.2.1.6">
                  .js, .mjs
                </dd>
                <dt pn="section-6.1.1-2.2.1.7">
Macintosh File Type Code(s):      </dt>
                <dd pn="section-6.1.1-2.2.1.8">
                  TEXT
                </dd>
              </dl>
            </dd>
          </dl>
          <dl newline="false" spacing="normal" indent="3" pn="section-6.1.1-3">
            <dt pn="section-6.1.1-3.1">
Person &amp; email address to contact for further information:  </dt>
            <dd pn="section-6.1.1-3.2">
              See the Authors' Addresses sections of RFC 9239 and <xref target="RFC4329" format="default" sectionFormat="of" derivedContent="RFC4329"/>.
            </dd>
            <dt pn="section-6.1.1-3.3">
Intended usage:  </dt>
            <dd pn="section-6.1.1-3.4">
              COMMON
            </dd>
            <dt pn="section-6.1.1-3.5">
Restrictions on usage:  </dt>
            <dd pn="section-6.1.1-3.6">
              The .mjs file extension signals that the file represents a JavaScript module. Execution environments that rely on file extensions to determine how to process inputs parse .mjs files using the Module grammar of <xref target="ECMA-262" format="default" sectionFormat="of" derivedContent="ECMA-262"/>.
            </dd>
            <dt pn="section-6.1.1-3.7">
Author:  </dt>
            <dd pn="section-6.1.1-3.8">
              See the Authors' Addresses sections of RFC 9239 and <xref target="RFC4329" format="default" sectionFormat="of" derivedContent="RFC4329"/>.
            </dd>
            <dt pn="section-6.1.1-3.9">
Change controller:  </dt>
            <dd pn="section-6.1.1-3.10">
              IESG &lt;iesg@ietf.org&gt;
            </dd>
          </dl>
        </section>
      </section>
      <section anchor="historic-javascript-media-types" numbered="true" toc="include" removeInRFC="false" pn="section-6.2">
        <name slugifiedName="name-historic-javascript-media-t">Historic JavaScript Media Types</name>
        <t indent="0" pn="section-6.2-1">The following media types and legacy aliases are added or updated for historical purposes. All herein have an intended usage of OBSOLETE and are not expected to be in use with modern implementations.</t>
        <section anchor="textecmascript" numbered="true" toc="include" removeInRFC="false" pn="section-6.2.1">
          <name slugifiedName="name-text-ecmascript">text/ecmascript</name>
          <dl indent="3" newline="false" spacing="normal" pn="section-6.2.1-1">
            <dt pn="section-6.2.1-1.1">
Type name:  </dt>
            <dd pn="section-6.2.1-1.2">
              text
            </dd>
            <dt pn="section-6.2.1-1.3">
Subtype name:  </dt>
            <dd pn="section-6.2.1-1.4">
              ecmascript
            </dd>
            <dt pn="section-6.2.1-1.5">
Required parameters:  </dt>
            <dd pn="section-6.2.1-1.6">
              N/A
            </dd>
            <dt pn="section-6.2.1-1.7">
Optional parameters:  </dt>
            <dd pn="section-6.2.1-1.8">
              charset. See <xref target="charset-parameter" format="default" sectionFormat="of" derivedContent="Section 4.1"/> of RFC 9239.
            </dd>
            <dt pn="section-6.2.1-1.9">
Encoding considerations:  </dt>
            <dd pn="section-6.2.1-1.10">
              Binary
            </dd>
            <dt pn="section-6.2.1-1.11">
Security considerations:  </dt>
            <dd pn="section-6.2.1-1.12">
              See <xref target="security-considerations" format="default" sectionFormat="of" derivedContent="Section 5"/> of RFC 9239.
            </dd>
            <dt pn="section-6.2.1-1.13">
Interoperability considerations:  </dt>
            <dd pn="section-6.2.1-1.14">
              It is expected that implementations will behave as if this registration applies to later editions of <xref target="ECMA-262" format="default" sectionFormat="of" derivedContent="ECMA-262"/>, and its published specification references may be updated accordingly from time to time. Although this expectation is unusual among media type registrations, it matches widespread industry conventions. See <xref target="compatibility" format="default" sectionFormat="of" derivedContent="Section 2"/> of RFC 9239.
            </dd>
            <dt pn="section-6.2.1-1.15">
Published specification:  </dt>
            <dd pn="section-6.2.1-1.16">
              <xref target="ECMA-262" format="default" sectionFormat="of" derivedContent="ECMA-262"/>
            </dd>
            <dt pn="section-6.2.1-1.17">
Applications that use this media type:  </dt>
            <dd pn="section-6.2.1-1.18">
              Script interpreters as discussed in RFC 9239.
            </dd>
          </dl>
          <dl newline="true" spacing="normal" indent="3" pn="section-6.2.1-2">
            <dt pn="section-6.2.1-2.1">Additional information:</dt>
            <dd pn="section-6.2.1-2.2">
              <dl newline="false" spacing="compact" indent="3" pn="section-6.2.1-2.2.1">
                <dt pn="section-6.2.1-2.2.1.1">
Deprecated alias names for this type:  </dt>
                <dd pn="section-6.2.1-2.2.1.2">
              application/ecmascript, application/x-ecmascript, text/x-ecmascript
            </dd>
                <dt pn="section-6.2.1-2.2.1.3">
Magic number(s):  </dt>
                <dd pn="section-6.2.1-2.2.1.4">
              N/A
            </dd>
                <dt pn="section-6.2.1-2.2.1.5">
File extension(s):  </dt>
                <dd pn="section-6.2.1-2.2.1.6">
              .es, .mjs
            </dd>
                <dt pn="section-6.2.1-2.2.1.7">
Macintosh File Type Code(s):  </dt>
                <dd pn="section-6.2.1-2.2.1.8">
              TEXT
            </dd>
              </dl>
            </dd>
          </dl>
          <dl newline="false" spacing="normal" indent="3" pn="section-6.2.1-3">
            <dt pn="section-6.2.1-3.1">
Person &amp; email address to contact for further information:  </dt>
            <dd pn="section-6.2.1-3.2">
              See the Authors' Addresses sections of RFC 9239 and <xref target="RFC4329" format="default" sectionFormat="of" derivedContent="RFC4329"/>.
            </dd>
            <dt pn="section-6.2.1-3.3">
Intended usage:  </dt>
            <dd pn="section-6.2.1-3.4">
              OBSOLETE
            </dd>
            <dt pn="section-6.2.1-3.5">
Restrictions on usage:  </dt>
            <dd pn="section-6.2.1-3.6">
              This media type is obsolete; current implementations should use text/javascript as the only JavaScript/ECMAScript media type. The .mjs file extension signals that the file represents a JavaScript module. Execution environments that rely on file extensions to determine how to process inputs parse .mjs files using the Module grammar of <xref target="ECMA-262" format="default" sectionFormat="of" derivedContent="ECMA-262"/>.
            </dd>
            <dt pn="section-6.2.1-3.7">
Author:  </dt>
            <dd pn="section-6.2.1-3.8">
              See the Authors' Addresses sections of RFC 9239 and <xref target="RFC4329" format="default" sectionFormat="of" derivedContent="RFC4329"/>.
            </dd>
            <dt pn="section-6.2.1-3.9">
Change controller:  </dt>
            <dd pn="section-6.2.1-3.10">
              IESG &lt;iesg@ietf.org&gt;
            </dd>
          </dl>
        </section>
      </section>
    </section>
  </middle>
  <back>
    <references pn="section-7">
      <name slugifiedName="name-references">References</name>
      <references pn="section-7.1">
        <name slugifiedName="name-normative-references">Normative References</name>
        <reference anchor="CHARSETS" target="https://www.iana.org/assignments/character-sets" quoteTitle="true" derivedAnchor="CHARSETS">
          <front>
            <title>Character Sets</title>
            <author>
              <organization showOnFrontPage="true">IANA</organization>
            </author>
          </front>
        </reference>
        <reference anchor="ECMA-262" target="https://262.ecma-international.org/12.0/" quoteTitle="true" derivedAnchor="ECMA-262">
          <front>
            <title>ECMA-262 12th Edition, June 2021.  ECMAScript 2021 language specification</title>
            <author>
              <organization showOnFrontPage="true">Ecma International</organization>
            </author>
            <date year="2021" month="June"/>
          </front>
        </reference>
        <reference anchor="RFC2045" target="https://www.rfc-editor.org/info/rfc2045" quoteTitle="true" derivedAnchor="RFC2045">
          <front>
            <title>Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</title>
            <author initials="N." surname="Freed" fullname="N. Freed">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="N." surname="Borenstein" fullname="N. Borenstein">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="1996" month="November"/>
            <abstract>
              <t indent="0">This initial document specifies the various headers used to describe the structure of MIME messages.  [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="2045"/>
          <seriesInfo name="DOI" value="10.17487/RFC2045"/>
        </reference>
        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119" quoteTitle="true" derivedAnchor="RFC2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author initials="S." surname="Bradner" fullname="S. Bradner">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="1997" month="March"/>
            <abstract>
              <t indent="0">In many standards track documents several words are used to signify the requirements in the specification.  These words are often capitalized. This document defines these words as they should be interpreted in IETF documents.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC2397" target="https://www.rfc-editor.org/info/rfc2397" quoteTitle="true" derivedAnchor="RFC2397">
          <front>
            <title>The "data" URL scheme</title>
            <author initials="L." surname="Masinter" fullname="L. Masinter">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="1998" month="August"/>
            <abstract>
              <t indent="0">A new URL scheme, "data", is defined. It allows inclusion of small data items as "immediate" data, as if it had been included externally. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="2397"/>
          <seriesInfo name="DOI" value="10.17487/RFC2397"/>
        </reference>
        <reference anchor="RFC2978" target="https://www.rfc-editor.org/info/rfc2978" quoteTitle="true" derivedAnchor="RFC2978">
          <front>
            <title>IANA Charset Registration Procedures</title>
            <author initials="N." surname="Freed" fullname="N. Freed">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="J." surname="Postel" fullname="J. Postel">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2000" month="October"/>
            <abstract>
              <t indent="0">Multipurpose Internet Mail Extensions (MIME) and various other Internet protocols are capable of using many different charsets.  This in turn means that the ability to label different charsets is essential.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="19"/>
          <seriesInfo name="RFC" value="2978"/>
          <seriesInfo name="DOI" value="10.17487/RFC2978"/>
        </reference>
        <reference anchor="RFC3552" target="https://www.rfc-editor.org/info/rfc3552" quoteTitle="true" derivedAnchor="RFC3552">
          <front>
            <title>Guidelines for Writing RFC Text on Security Considerations</title>
            <author initials="E." surname="Rescorla" fullname="E. Rescorla">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="B." surname="Korver" fullname="B. Korver">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2003" month="July"/>
            <abstract>
              <t indent="0">All RFCs are required to have a Security Considerations section. Historically, such sections have been relatively weak.  This document provides guidelines to RFC authors on how to write a good Security Considerations section.   This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="72"/>
          <seriesInfo name="RFC" value="3552"/>
          <seriesInfo name="DOI" value="10.17487/RFC3552"/>
        </reference>
        <reference anchor="RFC3629" target="https://www.rfc-editor.org/info/rfc3629" quoteTitle="true" derivedAnchor="RFC3629">
          <front>
            <title>UTF-8, a transformation format of ISO 10646</title>
            <author initials="F." surname="Yergeau" fullname="F. Yergeau">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2003" month="November"/>
            <abstract>
              <t indent="0">ISO/IEC 10646-1 defines a large character set called the Universal Character Set (UCS) which encompasses most of the world's writing systems.  The originally proposed encodings of the UCS, however, were not compatible with many current applications and protocols, and this has led to the development of UTF-8, the object of this memo.  UTF-8 has the characteristic of preserving the full US-ASCII range, providing compatibility with file systems, parsers and other software that rely on US-ASCII values but are transparent to other values.  This memo obsoletes and replaces RFC 2279.</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="63"/>
          <seriesInfo name="RFC" value="3629"/>
          <seriesInfo name="DOI" value="10.17487/RFC3629"/>
        </reference>
        <reference anchor="RFC4288" target="https://www.rfc-editor.org/info/rfc4288" quoteTitle="true" derivedAnchor="RFC4288">
          <front>
            <title>Media Type Specifications and Registration Procedures</title>
            <author initials="N." surname="Freed" fullname="N. Freed">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="J." surname="Klensin" fullname="J. Klensin">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2005" month="December"/>
            <abstract>
              <t indent="0">This document defines procedures for the specification and registration of media types for use in MIME and other Internet protocols.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="4288"/>
          <seriesInfo name="DOI" value="10.17487/RFC4288"/>
        </reference>
        <reference anchor="RFC4329" target="https://www.rfc-editor.org/info/rfc4329" quoteTitle="true" derivedAnchor="RFC4329">
          <front>
            <title>Scripting Media Types</title>
            <author initials="B." surname="Hoehrmann" fullname="B. Hoehrmann">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2006" month="April"/>
            <abstract>
              <t indent="0">This document describes the registration of media types for the ECMAScript and JavaScript programming languages and conformance requirements for implementations of these types.  This memo provides information for the Internet community.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="4329"/>
          <seriesInfo name="DOI" value="10.17487/RFC4329"/>
        </reference>
        <reference anchor="RFC6365" target="https://www.rfc-editor.org/info/rfc6365" quoteTitle="true" derivedAnchor="RFC6365">
          <front>
            <title>Terminology Used in Internationalization in the IETF</title>
            <author initials="P." surname="Hoffman" fullname="P. Hoffman">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="J." surname="Klensin" fullname="J. Klensin">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2011" month="September"/>
            <abstract>
              <t indent="0">This document provides a list of terms used in the IETF when discussing internationalization.  The purpose is to help frame discussions of internationalization in the various areas of the IETF and to help introduce the main concepts to IETF participants.   This memo documents an Internet Best Current Practice.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="166"/>
          <seriesInfo name="RFC" value="6365"/>
          <seriesInfo name="DOI" value="10.17487/RFC6365"/>
        </reference>
        <reference anchor="RFC6648" target="https://www.rfc-editor.org/info/rfc6648" quoteTitle="true" derivedAnchor="RFC6648">
          <front>
            <title>Deprecating the "X-" Prefix and Similar Constructs in Application Protocols</title>
            <author initials="P." surname="Saint-Andre" fullname="P. Saint-Andre">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="D." surname="Crocker" fullname="D. Crocker">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="M." surname="Nottingham" fullname="M. Nottingham">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2012" month="June"/>
            <abstract>
              <t indent="0">Historically, designers and implementers of application protocols have often distinguished between standardized and unstandardized parameters by prefixing the names of unstandardized parameters with the string "X-" or similar constructs.  In practice, that convention causes more problems than it solves.  Therefore, this document deprecates the convention for newly defined parameters with textual (as opposed to numerical) names in application protocols. This memo documents an Internet Best Current Practice.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="178"/>
          <seriesInfo name="RFC" value="6648"/>
          <seriesInfo name="DOI" value="10.17487/RFC6648"/>
        </reference>
        <reference anchor="RFC6838" target="https://www.rfc-editor.org/info/rfc6838" quoteTitle="true" derivedAnchor="RFC6838">
          <front>
            <title>Media Type Specifications and Registration Procedures</title>
            <author initials="N." surname="Freed" fullname="N. Freed">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="J." surname="Klensin" fullname="J. Klensin">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="T." surname="Hansen" fullname="T. Hansen">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2013" month="January"/>
            <abstract>
              <t indent="0">This document defines procedures for the specification and registration of media types for use in HTTP, MIME, and other Internet protocols.  This memo documents an Internet Best Current Practice.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="13"/>
          <seriesInfo name="RFC" value="6838"/>
          <seriesInfo name="DOI" value="10.17487/RFC6838"/>
        </reference>
        <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174" quoteTitle="true" derivedAnchor="RFC8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author initials="B." surname="Leiba" fullname="B. Leiba">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2017" month="May"/>
            <abstract>
              <t indent="0">RFC 2119 specifies common key words that may be used in protocol  specifications.  This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the  defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
      </references>
      <references pn="section-7.2">
        <name slugifiedName="name-informative-references">Informative References</name>
        <reference anchor="HTML" target="https://html.spec.whatwg.org/multipage/scripting.html#prepare-a-script" quoteTitle="true" derivedAnchor="HTML">
          <front>
            <title>HTML Living Standard</title>
            <author>
              <organization showOnFrontPage="true">WHATWG</organization>
            </author>
            <date year="2022" month="May"/>
          </front>
        </reference>
        <reference anchor="RFC3236" target="https://www.rfc-editor.org/info/rfc3236" quoteTitle="true" derivedAnchor="RFC3236">
          <front>
            <title>The 'application/xhtml+xml' Media Type</title>
            <author initials="M." surname="Baker" fullname="M. Baker">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="P." surname="Stark" fullname="P. Stark">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2002" month="January"/>
            <abstract>
              <t indent="0">This document defines the 'application/xhtml+xml' MIME media type for XHTML based markup languages; it is not intended to obsolete any previous IETF documents, in particular RFC 2854 which registers 'text/html'.  This memo provides information for the Internet community.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="3236"/>
          <seriesInfo name="DOI" value="10.17487/RFC3236"/>
        </reference>
        <reference anchor="RFC3875" target="https://www.rfc-editor.org/info/rfc3875" quoteTitle="true" derivedAnchor="RFC3875">
          <front>
            <title>The Common Gateway Interface (CGI) Version 1.1</title>
            <author initials="D." surname="Robinson" fullname="D. Robinson">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="K." surname="Coar" fullname="K. Coar">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2004" month="October"/>
            <abstract>
              <t indent="0">The Common Gateway Interface (CGI) is a simple interface for running external programs, software or gateways under an information server in a platform-independent manner.  Currently, the supported information servers are HTTP servers. </t>
              <t indent="0"> The interface has been in use by the World-Wide Web (WWW) since 1993.  This specification defines the 'current practice' parameters of the 'CGI/1.1' interface developed and documented at the U.S. National Centre for Supercomputing Applications.  This document also defines the use of the CGI/1.1 interface on UNIX(R) and other, similar systems.  This memo provides information for the Internet community.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="3875"/>
          <seriesInfo name="DOI" value="10.17487/RFC3875"/>
        </reference>
        <reference anchor="RFC3986" target="https://www.rfc-editor.org/info/rfc3986" quoteTitle="true" derivedAnchor="RFC3986">
          <front>
            <title>Uniform Resource Identifier (URI): Generic Syntax</title>
            <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="R." surname="Fielding" fullname="R. Fielding">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="L." surname="Masinter" fullname="L. Masinter">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2005" month="January"/>
            <abstract>
              <t indent="0">A Uniform Resource Identifier (URI) is a compact sequence of characters that identifies an abstract or physical resource.  This specification defines the generic URI syntax and a process for resolving URI references that might be in relative form, along with guidelines and security considerations for the use of URIs on the Internet.  The URI syntax defines a grammar that is a superset of all valid URIs, allowing an implementation to parse the common components of a URI reference without knowing the scheme-specific requirements of every possible identifier.  This specification does not define a generative grammar for URIs; that task is performed by the individual specifications of each URI scheme.  [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="66"/>
          <seriesInfo name="RFC" value="3986"/>
          <seriesInfo name="DOI" value="10.17487/RFC3986"/>
        </reference>
        <reference anchor="RFC3987" target="https://www.rfc-editor.org/info/rfc3987" quoteTitle="true" derivedAnchor="RFC3987">
          <front>
            <title>Internationalized Resource Identifiers (IRIs)</title>
            <author initials="M." surname="Duerst" fullname="M. Duerst">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="M." surname="Suignard" fullname="M. Suignard">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2005" month="January"/>
            <abstract>
              <t indent="0">This document defines a new protocol element, the Internationalized  Resource Identifier (IRI), as a complement of the Uniform Resource  Identifier (URI). An IRI is a sequence of characters from the  Universal Character Set (Unicode/ISO 10646). A mapping from IRIs to   URIs is defined, which means that IRIs can be used instead of URIs,  where appropriate, to identify resources.</t>
              <t indent="0"> The approach of defining a new protocol element was chosen instead of extending or changing the definition of URIs.  This was done in order  to allow a clear distinction and to avoid incompatibilities with  existing software. Guidelines are provided for the use and deployment of IRIs in various protocols, formats, and software components that currently deal with URIs.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="3987"/>
          <seriesInfo name="DOI" value="10.17487/RFC3987"/>
        </reference>
        <reference anchor="SPECTRE" target="https://arxiv.org/abs/1801.01203" quoteTitle="true" derivedAnchor="SPECTRE">
          <front>
            <title>Spectre Attacks: Exploiting Speculative Execution</title>
            <author initials="P." surname="Kocher" fullname="Paul Kocher">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="D." surname="Genkin" fullname="Daniel Genkin">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="D." surname="Gruss" fullname="Daniel Gruss">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="W." surname="Haas" fullname="Werner Haas">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="M." surname="Hamburg" fullname="Mike Hamburg">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="M." surname="Lipp" fullname="Moritz Lipp">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="S." surname="Mangard" fullname="Stefan Mangard">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="T." surname="Prescher" fullname="Thomas Prescher">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="M." surname="Schwarz" fullname="Michael Schwarz">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="Y." surname="Yarom" fullname="Yuval Yarom">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2018" month="January"/>
          </front>
          <seriesInfo name="DOI" value="10.48550/arXiv.1801.01203"/>
        </reference>
        <reference anchor="TC39-MIME-ISSUE" target="https://web.archive.org/web/20170814193912/https://github.com/tc39/ecma262/issues/322" quoteTitle="true" derivedAnchor="TC39-MIME-ISSUE">
          <front>
            <title>Add 'application/javascript+module' mime to remove ambiguity</title>
            <author>
              <organization showOnFrontPage="true">TC39</organization>
            </author>
            <date year="2017" month="August"/>
          </front>
          <refcontent>Wayback Machine archive</refcontent>
        </reference>
      </references>
    </references>
    <section anchor="changes-from-rfc-4329" numbered="true" toc="include" removeInRFC="false" pn="section-appendix.a">
      <name slugifiedName="name-changes-from-rfc-4329">Changes from RFC 4329</name>
      <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-appendix.a-1">
        <li pn="section-appendix.a-1.1">Added a section discussing ECMAScript modules and the impact on processing.</li>
        <li pn="section-appendix.a-1.2">Updated the Security Considerations section to discuss concerns associated with ECMAScript modules and SharedArrayBuffers.</li>
        <li pn="section-appendix.a-1.3">Updated the character encoding scheme detection to remove normative guidance on its use, to better reflect operational reality.</li>
        <li pn="section-appendix.a-1.4">Changed the intended usage of the media type "text/javascript" from OBSOLETE to COMMON.</li>
        <li pn="section-appendix.a-1.5">Changed the intended usage for all other script media types to obsolete.</li>
        <li pn="section-appendix.a-1.6">Updated various references where the original has been obsoleted.</li>
        <li pn="section-appendix.a-1.7">Updated references to ECMA-262 to match the version at the time of publication.</li>
      </ul>
    </section>
    <section anchor="acknowledgements" numbered="false" toc="include" removeInRFC="false" pn="section-appendix.b">
      <name slugifiedName="name-acknowledgements">Acknowledgements</name>
      <t indent="0" pn="section-appendix.b-1">This work builds upon its antecedent document, authored by <contact fullname="Björn Höhrmann"/>.  The authors would like to thank
<contact fullname="Adam Roach"/>,
<contact fullname="Alexey Melnikov"/>,
<contact fullname="Allen Wirfs-Brock"/>,
<contact fullname="Anne van Kesteren"/>,
<contact fullname="Ben Campbell"/>,
<contact fullname="Benjamin Kaduk"/>,
<contact fullname="Éric Vyncke"/>,
<contact fullname="Francesca Palombini"/>,
<contact fullname="James Snell"/>,
<contact fullname="Kirsty Paine"/>,
<contact fullname="Mark Nottingham"/>,
<contact fullname="Murray Kucherawy"/>,
<contact fullname="Ned Freed"/>,
<contact fullname="Robert Sparks"/>, and
<contact fullname="Suresh Krishnan"/>
for their guidance and feedback throughout this process.</t>
    </section>
    <section anchor="authors-addresses" numbered="false" removeInRFC="false" toc="include" pn="section-appendix.c">
      <name slugifiedName="name-authors-addresses">Authors' Addresses</name>
      <author initials="M." surname="Miller" fullname="Matthew A. Miller">
        <organization showOnFrontPage="true"/>
        <address>
          <email>linuxwolf+ietf@outer-planes.net</email>
        </address>
      </author>
      <author initials="M." surname="Borins" fullname="Myles Borins">
        <organization showOnFrontPage="true">GitHub</organization>
        <address>
          <email>mylesborins@github.com</email>
        </address>
      </author>
      <author initials="M." surname="Bynens" fullname="Mathias Bynens">
        <organization showOnFrontPage="true">Google</organization>
        <address>
          <email>mths@google.com</email>
        </address>
      </author>
      <author initials="B." surname="Farias" fullname="Bradley Farias">
        <organization showOnFrontPage="true"/>
        <address>
          <email>bradley.meck@gmail.com</email>
        </address>
      </author>
    </section>
  </back>
</rfc>
