Files
ask262/spec-built/multipage/ecmascript-language-source-code.html

148 lines
47 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html><html lang="en-GB-oxendict"><head><meta name="viewport" content="width=device-width, initial-scale=1"><meta charset="utf-8"><meta property="og:image" content="https://tc39.es/ecmarkup/ecma-logo.png"><meta property="og:title" content="ECMAScript® 2026 Language&nbsp;Specification"><meta property="og:description" content="Introduction
This Ecma Standard defines the ECMAScript 2026 Language. It is the seventeenth edition of the ECMAScript Language Specification. ECMAScript is based on several originating technologies, the most well-known being JavaScript (Netscape) and JScript (Microsoft). The language was invent">
<link rel="icon" href="../img/favicon.ico">
<link rel="stylesheet" href="../assets/css/ecmarkup.css"><link rel="stylesheet" href="../assets/css/print.css" media="print">
<title>ECMAScript® 2026 Language&nbsp;Specification</title><script src="../assets/js/multipage.js?cache=Wu2V1pj2" defer=""></script><script src="../assets/js/ecmarkup.js?cache=BPFBckdu" defer=""></script><link rel="canonical" href="../#sec-ecmascript-language-source-code"></head>
<body><div id="spec-container"><emu-clause id="sec-ecmascript-language-source-code">
<h1><span class="secnum">11</span> ECMAScript Language: Source Text</h1>
<emu-clause id="sec-source-text">
<h1><span class="secnum">11.1</span> Source Text</h1>
<h2>Syntax</h2>
<emu-grammar type="definition"><emu-production name="SourceCharacter" type="lexical" id="prod-SourceCharacter">
<emu-nt><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="xks4vqzw">
<emu-gprose>any Unicode code point</emu-gprose>
</emu-rhs>
</emu-production>
</emu-grammar>
<p><dfn tabindex="-1">ECMAScript source text</dfn> is a sequence of Unicode code points. All Unicode code point values from U+0000 to U+10FFFF, including surrogate code points, may occur in ECMAScript source text where permitted by the ECMAScript grammars. The actual encodings used to store and interchange ECMAScript source text is not relevant to this specification. Regardless of the external source text encoding, a conforming ECMAScript implementation processes the source text as if it was an equivalent sequence of <emu-nt id="_ref_19531"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> values, each <emu-nt id="_ref_19532"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> being a Unicode code point. Conforming ECMAScript implementations are not required to perform any normalization of source text, or behave as though they were performing normalization of source text.</p>
<p>The components of a combining character sequence are treated as individual Unicode code points even though a user might think of the whole sequence as a single character.</p>
<emu-note><span class="note">Note</span><div class="note-contents">
<p>In string literals, regular expression literals, template literals and identifiers, any Unicode code point may also be expressed using Unicode escape sequences that explicitly express a code point's numeric value. Within a comment, such an escape sequence is effectively ignored as part of the comment.</p>
<p>ECMAScript differs from the Java programming language in the behaviour of Unicode escape sequences. In a Java program, if the Unicode escape sequence <code>\u000A</code>, for example, occurs within a single-line comment, it is interpreted as a line terminator (Unicode code point U+000A is LINE FEED (LF)) and therefore the next code point is not part of the comment. Similarly, if the Unicode escape sequence <code>\u000A</code> occurs within a string literal in a Java program, it is likewise interpreted as a line terminator, which is not allowed within a string literal—one must write <code>\n</code> instead of <code>\u000A</code> to cause a LINE FEED (LF) to be part of the value of a string literal. In an ECMAScript program, a Unicode escape sequence occurring within a comment is never interpreted and therefore cannot contribute to termination of the comment. Similarly, a Unicode escape sequence occurring within a string literal in an ECMAScript program always contributes to the literal and is never interpreted as a line terminator or as a code point that might terminate the string literal.</p>
</div></emu-note>
<emu-clause id="sec-utf16encodecodepoint" type="abstract operation" oldids="sec-utf16encoding,sec-codepointtoutf16codeunits" aoid="UTF16EncodeCodePoint"><span id="sec-codepointtoutf16codeunits"></span><span id="sec-utf16encoding"></span>
<h1><span class="secnum">11.1.1</span> Static Semantics: UTF16EncodeCodePoint ( <var>cp</var> )</h1>
<p>The abstract operation UTF16EncodeCodePoint takes argument <var>cp</var> (a Unicode code point) and returns a String. It performs the following steps when called:</p>
<emu-alg><ol><li><emu-xref href="#assert" id="_ref_5782"><a href="notational-conventions.html#assert">Assert</a></emu-xref>: 0 ≤ <var>cp</var> ≤ 0x10FFFF.</li><li>If <var>cp</var> ≤ 0xFFFF, return the String value consisting of the code unit whose numeric value is <var>cp</var>.</li><li>Let <var>cu1</var> be the code unit whose numeric value is <emu-xref aoid="floor" id="_ref_5783"><a href="notational-conventions.html#eqn-floor">floor</a></emu-xref>((<var>cp</var> - 0x10000) / 0x400) + 0xD800.</li><li>Let <var>cu2</var> be the code unit whose numeric value is ((<var>cp</var> - 0x10000) <emu-xref aoid="modulo" id="_ref_5784"><a href="notational-conventions.html#eqn-modulo">modulo</a></emu-xref> 0x400) + 0xDC00.</li><li>Return the <emu-xref href="#string-concatenation" id="_ref_5785"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of <var>cu1</var> and <var>cu2</var>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-codepointstostring" type="abstract operation" oldids="sec-utf16encode" aoid="CodePointsToString"><span id="sec-utf16encode"></span>
<h1><span class="secnum">11.1.2</span> Static Semantics: CodePointsToString ( <var>text</var> )</h1>
<p>The abstract operation CodePointsToString takes argument <var>text</var> (a sequence of Unicode code points) and returns a String. It converts <var>text</var> into a String value, as described in <emu-xref href="#sec-ecmascript-language-types-string-type" id="_ref_341"><a href="ecmascript-data-types-and-values.html#sec-ecmascript-language-types-string-type">6.1.4</a></emu-xref>. It performs the following steps when called:</p>
<emu-alg><ol><li>Let <var>result</var> be the empty String.</li><li>For each code point <var>cp</var> of <var>text</var>, do<ol><li>Set <var>result</var> to the <emu-xref href="#string-concatenation" id="_ref_5786"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of <var>result</var> and <emu-xref aoid="UTF16EncodeCodePoint" id="_ref_5787"><a href="ecmascript-language-source-code.html#sec-utf16encodecodepoint">UTF16EncodeCodePoint</a></emu-xref>(<var>cp</var>).</li></ol></li><li>Return <var>result</var>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-utf16decodesurrogatepair" type="abstract operation" oldids="sec-utf16decode,utf16decodesurrogatepair" aoid="UTF16SurrogatePairToCodePoint"><span id="utf16decodesurrogatepair"></span><span id="sec-utf16decode"></span>
<h1><span class="secnum">11.1.3</span> Static Semantics: UTF16SurrogatePairToCodePoint ( <var>lead</var>, <var>trail</var> )</h1>
<p>The abstract operation UTF16SurrogatePairToCodePoint takes arguments <var>lead</var> (a code unit) and <var>trail</var> (a code unit) and returns a code point. Two code units that form a UTF-16 <emu-xref href="#surrogate-pair" id="_ref_5788"><a href="ecmascript-data-types-and-values.html#surrogate-pair">surrogate pair</a></emu-xref> are converted to a code point. It performs the following steps when called:</p>
<emu-alg><ol><li><emu-xref href="#assert" id="_ref_5789"><a href="notational-conventions.html#assert">Assert</a></emu-xref>: <var>lead</var> is a <emu-xref href="#leading-surrogate" id="_ref_5790"><a href="ecmascript-data-types-and-values.html#leading-surrogate">leading surrogate</a></emu-xref> and <var>trail</var> is a <emu-xref href="#trailing-surrogate" id="_ref_5791"><a href="ecmascript-data-types-and-values.html#trailing-surrogate">trailing surrogate</a></emu-xref>.</li><li>Let <var>cp</var> be (<var>lead</var> - 0xD800) × 0x400 + (<var>trail</var> - 0xDC00) + 0x10000.</li><li>Return the code point <var>cp</var>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-codepointat" type="abstract operation" aoid="CodePointAt">
<h1><span class="secnum">11.1.4</span> Static Semantics: CodePointAt ( <var>string</var>, <var>position</var> )</h1>
<p>The abstract operation CodePointAt takes arguments <var>string</var> (a String) and <var>position</var> (a non-negative <emu-xref href="#integer" id="_ref_5792"><a href="notational-conventions.html#integer">integer</a></emu-xref>) and returns a <emu-xref href="#sec-list-and-record-specification-type" id="_ref_5793"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">Record</a></emu-xref> with fields <var class="field">[[CodePoint]]</var> (a code point), <var class="field">[[CodeUnitCount]]</var> (a positive <emu-xref href="#integer" id="_ref_5794"><a href="notational-conventions.html#integer">integer</a></emu-xref>), and <var class="field">[[IsUnpairedSurrogate]]</var> (a Boolean). It interprets <var>string</var> as a sequence of UTF-16 encoded code points, as described in <emu-xref href="#sec-ecmascript-language-types-string-type" id="_ref_342"><a href="ecmascript-data-types-and-values.html#sec-ecmascript-language-types-string-type">6.1.4</a></emu-xref>, and reads from it a single code point starting with the code unit at index <var>position</var>. It performs the following steps when called:</p>
<emu-alg><ol><li>Let <var>size</var> be the length of <var>string</var>.</li><li><emu-xref href="#assert" id="_ref_5795"><a href="notational-conventions.html#assert">Assert</a></emu-xref>: <var>position</var> ≥ 0 and <var>position</var> &lt; <var>size</var>.</li><li>Let <var>first</var> be the code unit at index <var>position</var> within <var>string</var>.</li><li>Let <var>cp</var> be the code point whose numeric value is the numeric value of <var>first</var>.</li><li>If <var>first</var> is neither a <emu-xref href="#leading-surrogate" id="_ref_5796"><a href="ecmascript-data-types-and-values.html#leading-surrogate">leading surrogate</a></emu-xref> nor a <emu-xref href="#trailing-surrogate" id="_ref_5797"><a href="ecmascript-data-types-and-values.html#trailing-surrogate">trailing surrogate</a></emu-xref>, then<ol><li>Return the <emu-xref href="#sec-list-and-record-specification-type" id="_ref_5798"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">Record</a></emu-xref> { <var class="field">[[CodePoint]]</var>: <var>cp</var>, <var class="field">[[CodeUnitCount]]</var>: 1, <var class="field">[[IsUnpairedSurrogate]]</var>: <emu-val>false</emu-val>&nbsp;}.</li></ol></li><li>If <var>first</var> is a <emu-xref href="#trailing-surrogate" id="_ref_5799"><a href="ecmascript-data-types-and-values.html#trailing-surrogate">trailing surrogate</a></emu-xref> or <var>position</var> + 1 = <var>size</var>, then<ol><li>Return the <emu-xref href="#sec-list-and-record-specification-type" id="_ref_5800"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">Record</a></emu-xref> { <var class="field">[[CodePoint]]</var>: <var>cp</var>, <var class="field">[[CodeUnitCount]]</var>: 1, <var class="field">[[IsUnpairedSurrogate]]</var>: <emu-val>true</emu-val>&nbsp;}.</li></ol></li><li>Let <var>second</var> be the code unit at index <var>position</var> + 1 within <var>string</var>.</li><li>If <var>second</var> is not a <emu-xref href="#trailing-surrogate" id="_ref_5801"><a href="ecmascript-data-types-and-values.html#trailing-surrogate">trailing surrogate</a></emu-xref>, then<ol><li>Return the <emu-xref href="#sec-list-and-record-specification-type" id="_ref_5802"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">Record</a></emu-xref> { <var class="field">[[CodePoint]]</var>: <var>cp</var>, <var class="field">[[CodeUnitCount]]</var>: 1, <var class="field">[[IsUnpairedSurrogate]]</var>: <emu-val>true</emu-val>&nbsp;}.</li></ol></li><li>Set <var>cp</var> to <emu-xref aoid="UTF16SurrogatePairToCodePoint" id="_ref_5803"><a href="ecmascript-language-source-code.html#sec-utf16decodesurrogatepair">UTF16SurrogatePairToCodePoint</a></emu-xref>(<var>first</var>, <var>second</var>).</li><li>Return the <emu-xref href="#sec-list-and-record-specification-type" id="_ref_5804"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">Record</a></emu-xref> { <var class="field">[[CodePoint]]</var>: <var>cp</var>, <var class="field">[[CodeUnitCount]]</var>: 2, <var class="field">[[IsUnpairedSurrogate]]</var>: <emu-val>false</emu-val>&nbsp;}.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-stringtocodepoints" type="abstract operation" oldids="sec-utf16decodestring" aoid="StringToCodePoints"><span id="sec-utf16decodestring"></span>
<h1><span class="secnum">11.1.5</span> Static Semantics: StringToCodePoints ( <var>string</var> )</h1>
<p>The abstract operation StringToCodePoints takes argument <var>string</var> (a String) and returns a <emu-xref href="#sec-list-and-record-specification-type" id="_ref_5805"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref> of code points. It returns the sequence of Unicode code points that results from interpreting <var>string</var> as UTF-16 encoded Unicode text as described in <emu-xref href="#sec-ecmascript-language-types-string-type" id="_ref_343"><a href="ecmascript-data-types-and-values.html#sec-ecmascript-language-types-string-type">6.1.4</a></emu-xref>. It performs the following steps when called:</p>
<emu-alg><ol><li>Let <var>codePoints</var> be a new empty <emu-xref href="#sec-list-and-record-specification-type" id="_ref_5806"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref>.</li><li>Let <var>size</var> be the length of <var>string</var>.</li><li>Let <var>position</var> be 0.</li><li>Repeat, while <var>position</var> &lt; <var>size</var>,<ol><li>Let <var>cp</var> be <emu-xref aoid="CodePointAt" id="_ref_5807"><a href="ecmascript-language-source-code.html#sec-codepointat">CodePointAt</a></emu-xref>(<var>string</var>, <var>position</var>).</li><li>Append <var>cp</var>.<var class="field">[[CodePoint]]</var> to <var>codePoints</var>.</li><li>Set <var>position</var> to <var>position</var> + <var>cp</var>.<var class="field">[[CodeUnitCount]]</var>.</li></ol></li><li>Return <var>codePoints</var>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-parsetext" type="abstract operation" aoid="ParseText">
<h1><span class="secnum">11.1.6</span> Static Semantics: ParseText ( <var>sourceText</var>, <var>goalSymbol</var> )</h1>
<p>The abstract operation ParseText takes arguments <var>sourceText</var> (a String or a sequence of Unicode code points) and <var>goalSymbol</var> (a nonterminal in one of the ECMAScript grammars) and returns a <emu-xref href="#sec-syntactic-grammar" id="_ref_5808"><a href="notational-conventions.html#sec-syntactic-grammar">Parse Node</a></emu-xref> or a non-empty <emu-xref href="#sec-list-and-record-specification-type" id="_ref_5809"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref> of <emu-val>SyntaxError</emu-val> objects. It performs the following steps when called:</p>
<emu-alg><ol><li>If <var>sourceText</var> <emu-xref href="#sec-ecmascript-language-types-string-type" id="_ref_5810"><a href="ecmascript-data-types-and-values.html#sec-ecmascript-language-types-string-type">is a String</a></emu-xref>, set <var>sourceText</var> to <emu-xref aoid="StringToCodePoints" id="_ref_5811"><a href="ecmascript-language-source-code.html#sec-stringtocodepoints">StringToCodePoints</a></emu-xref>(<var>sourceText</var>).</li><li>Attempt to parse <var>sourceText</var> using <var>goalSymbol</var> as the <emu-xref href="#sec-context-free-grammars" id="_ref_5812"><a href="notational-conventions.html#sec-context-free-grammars">goal symbol</a></emu-xref>, and analyse the parse result for any <emu-xref href="#early-error" id="_ref_5813"><a href="error-handling-and-language-extensions.html#early-error">early error</a></emu-xref> conditions. Parsing and <emu-xref href="#early-error" id="_ref_5814"><a href="error-handling-and-language-extensions.html#early-error">early error</a></emu-xref> detection may be interleaved in an <emu-xref href="#implementation-defined" id="_ref_5815"><a href="overview.html#implementation-defined">implementation-defined</a></emu-xref> manner.</li><li>If the parse succeeded and no <emu-xref href="#early-error" id="_ref_5816"><a href="error-handling-and-language-extensions.html#early-error">early errors</a></emu-xref> were found, return the <emu-xref href="#sec-syntactic-grammar" id="_ref_5817"><a href="notational-conventions.html#sec-syntactic-grammar">Parse Node</a></emu-xref> (an instance of <var>goalSymbol</var>) at the root of the parse tree resulting from the parse.</li><li>Return a <emu-xref href="#sec-list-and-record-specification-type" id="_ref_5818"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref> of one or more <emu-val>SyntaxError</emu-val> objects representing the parsing errors and/or <emu-xref href="#early-error" id="_ref_5819"><a href="error-handling-and-language-extensions.html#early-error">early errors</a></emu-xref>. If more than one parsing error or <emu-xref href="#early-error" id="_ref_5820"><a href="error-handling-and-language-extensions.html#early-error">early error</a></emu-xref> is present, the number and ordering of error objects in the list is <emu-xref href="#implementation-defined" id="_ref_5821"><a href="overview.html#implementation-defined">implementation-defined</a></emu-xref>, but at least one must be present.</li></ol></emu-alg>
<emu-note><span class="note">Note 1</span><div class="note-contents">
<p>Consider a text that has an <emu-xref href="#early-error" id="_ref_5822"><a href="error-handling-and-language-extensions.html#early-error">early error</a></emu-xref> at a particular point, and also a syntax error at a later point. An implementation that does a parse pass followed by an <emu-xref href="#early-error" id="_ref_5823"><a href="error-handling-and-language-extensions.html#early-error">early errors</a></emu-xref> pass might report the syntax error and not proceed to the <emu-xref href="#early-error" id="_ref_5824"><a href="error-handling-and-language-extensions.html#early-error">early errors</a></emu-xref> pass. An implementation that interleaves the two activities might report the <emu-xref href="#early-error" id="_ref_5825"><a href="error-handling-and-language-extensions.html#early-error">early error</a></emu-xref> and not proceed to find the syntax error. A third implementation might report both errors. All of these behaviours are conformant.</p>
</div></emu-note>
<emu-note><span class="note">Note 2</span><div class="note-contents">
<p>See also clause <emu-xref href="#sec-error-handling-and-language-extensions" id="_ref_344"><a href="error-handling-and-language-extensions.html#sec-error-handling-and-language-extensions">17</a></emu-xref>.</p>
</div></emu-note>
</emu-clause>
</emu-clause>
<emu-clause id="sec-types-of-source-code">
<h1><span class="secnum">11.2</span> Types of Source Code</h1>
<p>There are four types of ECMAScript code:</p>
<ul>
<li>
<dfn tabindex="-1">Global code</dfn> is source text that is treated as an ECMAScript <emu-nt id="_ref_19533"><a href="ecmascript-language-scripts-and-modules.html#prod-Script">Script</a></emu-nt>. The global code of a particular <emu-nt id="_ref_19534"><a href="ecmascript-language-scripts-and-modules.html#prod-Script">Script</a></emu-nt> does not include any source text that is parsed as part of a <emu-nt id="_ref_19535"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt>, <emu-nt id="_ref_19536"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionExpression">FunctionExpression</a></emu-nt>, <emu-nt id="_ref_19537"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorDeclaration">GeneratorDeclaration</a></emu-nt>, <emu-nt id="_ref_19538"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorExpression">GeneratorExpression</a></emu-nt>, <emu-nt id="_ref_19539"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionDeclaration">AsyncFunctionDeclaration</a></emu-nt>, <emu-nt id="_ref_19540"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionExpression">AsyncFunctionExpression</a></emu-nt>, <emu-nt id="_ref_19541"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorDeclaration">AsyncGeneratorDeclaration</a></emu-nt>, <emu-nt id="_ref_19542"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorExpression">AsyncGeneratorExpression</a></emu-nt>, <emu-nt id="_ref_19543"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt>, <emu-nt id="_ref_19544"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFunction">ArrowFunction</a></emu-nt>, <emu-nt id="_ref_19545"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowFunction">AsyncArrowFunction</a></emu-nt>, <emu-nt id="_ref_19546"><a href="ecmascript-language-functions-and-classes.html#prod-ClassDeclaration">ClassDeclaration</a></emu-nt>, or <emu-nt id="_ref_19547"><a href="ecmascript-language-functions-and-classes.html#prod-ClassExpression">ClassExpression</a></emu-nt>.
</li>
<li>
<dfn tabindex="-1">Eval code</dfn> is the source text supplied to the built-in <code>eval</code> function. More precisely, if the parameter to the built-in <code>eval</code> function <emu-xref href="#sec-ecmascript-language-types-string-type" id="_ref_5826"><a href="ecmascript-data-types-and-values.html#sec-ecmascript-language-types-string-type">is a String</a></emu-xref>, it is treated as an ECMAScript <emu-nt id="_ref_19548"><a href="ecmascript-language-scripts-and-modules.html#prod-Script">Script</a></emu-nt>. The eval code for a particular invocation of <code>eval</code> is the global code portion of that <emu-nt id="_ref_19549"><a href="ecmascript-language-scripts-and-modules.html#prod-Script">Script</a></emu-nt>.
</li>
<li>
<p><dfn tabindex="-1">Function code</dfn> is source text that is parsed to supply the value of the <var class="field">[[ECMAScriptCode]]</var> and <var class="field">[[FormalParameters]]</var> internal slots (see <emu-xref href="#sec-ecmascript-function-objects" id="_ref_345"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ecmascript-function-objects">10.2</a></emu-xref>) of an ECMAScript <emu-xref href="#function-object" id="_ref_5827"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref>. The function code of a particular ECMAScript function does not include any source text that is parsed as the function code of a nested <emu-nt id="_ref_19550"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt>, <emu-nt id="_ref_19551"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionExpression">FunctionExpression</a></emu-nt>, <emu-nt id="_ref_19552"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorDeclaration">GeneratorDeclaration</a></emu-nt>, <emu-nt id="_ref_19553"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorExpression">GeneratorExpression</a></emu-nt>, <emu-nt id="_ref_19554"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionDeclaration">AsyncFunctionDeclaration</a></emu-nt>, <emu-nt id="_ref_19555"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionExpression">AsyncFunctionExpression</a></emu-nt>, <emu-nt id="_ref_19556"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorDeclaration">AsyncGeneratorDeclaration</a></emu-nt>, <emu-nt id="_ref_19557"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorExpression">AsyncGeneratorExpression</a></emu-nt>, <emu-nt id="_ref_19558"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt>, <emu-nt id="_ref_19559"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFunction">ArrowFunction</a></emu-nt>, <emu-nt id="_ref_19560"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowFunction">AsyncArrowFunction</a></emu-nt>, <emu-nt id="_ref_19561"><a href="ecmascript-language-functions-and-classes.html#prod-ClassDeclaration">ClassDeclaration</a></emu-nt>, or <emu-nt id="_ref_19562"><a href="ecmascript-language-functions-and-classes.html#prod-ClassExpression">ClassExpression</a></emu-nt>.</p>
<p>In addition, if the source text referred to above is parsed as:</p>
<ul>
<li>the <emu-nt id="_ref_19563"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> and <emu-nt id="_ref_19564"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt> of a <emu-nt id="_ref_19565"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt> or <emu-nt id="_ref_19566"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionExpression">FunctionExpression</a></emu-nt>,</li>
<li>the <emu-nt id="_ref_19567"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> and <emu-nt id="_ref_19568"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt> of a <emu-nt id="_ref_19569"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorDeclaration">GeneratorDeclaration</a></emu-nt> or <emu-nt id="_ref_19570"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorExpression">GeneratorExpression</a></emu-nt>,</li>
<li>the <emu-nt id="_ref_19571"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> and <emu-nt id="_ref_19572"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt> of an <emu-nt id="_ref_19573"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionDeclaration">AsyncFunctionDeclaration</a></emu-nt> or <emu-nt id="_ref_19574"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionExpression">AsyncFunctionExpression</a></emu-nt>, or</li>
<li>the <emu-nt id="_ref_19575"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> and <emu-nt id="_ref_19576"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt> of an <emu-nt id="_ref_19577"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorDeclaration">AsyncGeneratorDeclaration</a></emu-nt> or <emu-nt id="_ref_19578"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorExpression">AsyncGeneratorExpression</a></emu-nt>,</li>
</ul>
<p>then the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_5828"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> the <emu-nt id="_ref_19579"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> (if any) of that declaration or expression is also included in the function code of the corresponding function.</p>
</li>
<li>
<dfn tabindex="-1">Module code</dfn> is source text that is code that is provided as a <emu-nt id="_ref_19580"><a href="ecmascript-language-scripts-and-modules.html#prod-ModuleBody">ModuleBody</a></emu-nt>. It is the code that is directly evaluated when a module is initialized. The module code of a particular module does not include any source text that is parsed as part of a nested <emu-nt id="_ref_19581"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt>, <emu-nt id="_ref_19582"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionExpression">FunctionExpression</a></emu-nt>, <emu-nt id="_ref_19583"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorDeclaration">GeneratorDeclaration</a></emu-nt>, <emu-nt id="_ref_19584"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorExpression">GeneratorExpression</a></emu-nt>, <emu-nt id="_ref_19585"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionDeclaration">AsyncFunctionDeclaration</a></emu-nt>, <emu-nt id="_ref_19586"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionExpression">AsyncFunctionExpression</a></emu-nt>, <emu-nt id="_ref_19587"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorDeclaration">AsyncGeneratorDeclaration</a></emu-nt>, <emu-nt id="_ref_19588"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorExpression">AsyncGeneratorExpression</a></emu-nt>, <emu-nt id="_ref_19589"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt>, <emu-nt id="_ref_19590"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFunction">ArrowFunction</a></emu-nt>, <emu-nt id="_ref_19591"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowFunction">AsyncArrowFunction</a></emu-nt>, <emu-nt id="_ref_19592"><a href="ecmascript-language-functions-and-classes.html#prod-ClassDeclaration">ClassDeclaration</a></emu-nt>, or <emu-nt id="_ref_19593"><a href="ecmascript-language-functions-and-classes.html#prod-ClassExpression">ClassExpression</a></emu-nt>.
</li>
</ul>
<emu-note><span class="note">Note 1</span><div class="note-contents">
<p>Function code is generally provided as the bodies of Function Definitions (<emu-xref href="#sec-function-definitions" id="_ref_346"><a href="ecmascript-language-functions-and-classes.html#sec-function-definitions">15.2</a></emu-xref>), Arrow Function Definitions (<emu-xref href="#sec-arrow-function-definitions" id="_ref_347"><a href="ecmascript-language-functions-and-classes.html#sec-arrow-function-definitions">15.3</a></emu-xref>), Method Definitions (<emu-xref href="#sec-method-definitions" id="_ref_348"><a href="ecmascript-language-functions-and-classes.html#sec-method-definitions">15.4</a></emu-xref>), Generator Function Definitions (<emu-xref href="#sec-generator-function-definitions" id="_ref_349"><a href="ecmascript-language-functions-and-classes.html#sec-generator-function-definitions">15.5</a></emu-xref>), Async Function Definitions (<emu-xref href="#sec-async-function-definitions" id="_ref_350"><a href="ecmascript-language-functions-and-classes.html#sec-async-function-definitions">15.8</a></emu-xref>), Async Generator Function Definitions (<emu-xref href="#sec-async-generator-function-definitions" id="_ref_351"><a href="ecmascript-language-functions-and-classes.html#sec-async-generator-function-definitions">15.6</a></emu-xref>), and Async Arrow Functions (<emu-xref href="#sec-async-arrow-function-definitions" id="_ref_352"><a href="ecmascript-language-functions-and-classes.html#sec-async-arrow-function-definitions">15.9</a></emu-xref>). Function code is also derived from the arguments to the Function <emu-xref href="#constructor" id="_ref_5829"><a href="ecmascript-data-types-and-values.html#constructor">constructor</a></emu-xref> (<emu-xref href="#sec-function-p1-p2-pn-body" id="_ref_353"><a href="fundamental-objects.html#sec-function-p1-p2-pn-body">20.2.1.1</a></emu-xref>), the GeneratorFunction <emu-xref href="#constructor" id="_ref_5830"><a href="ecmascript-data-types-and-values.html#constructor">constructor</a></emu-xref> (<emu-xref href="#sec-generatorfunction" id="_ref_354"><a href="control-abstraction-objects.html#sec-generatorfunction">27.3.1.1</a></emu-xref>), the AsyncFunction <emu-xref href="#constructor" id="_ref_5831"><a href="ecmascript-data-types-and-values.html#constructor">constructor</a></emu-xref> (<emu-xref href="#sec-async-function-constructor-arguments" id="_ref_355"><a href="control-abstraction-objects.html#sec-async-function-constructor-arguments">27.7.1.1</a></emu-xref>), and the AsyncGeneratorFunction <emu-xref href="#constructor" id="_ref_5832"><a href="ecmascript-data-types-and-values.html#constructor">constructor</a></emu-xref> (<emu-xref href="#sec-asyncgeneratorfunction" id="_ref_356"><a href="control-abstraction-objects.html#sec-asyncgeneratorfunction">27.4.1.1</a></emu-xref>).</p>
</div></emu-note>
<emu-note><span class="note">Note 2</span><div class="note-contents">
<p>The practical effect of including the <emu-nt id="_ref_19594"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> in function code is that the Early Errors for <emu-xref href="#sec-strict-mode-code" id="_ref_5833"><a href="ecmascript-language-source-code.html#sec-strict-mode-code">strict mode code</a></emu-xref> are applied to a <emu-nt id="_ref_19595"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> that is the name of a function whose body contains a "use strict" directive, even if the surrounding code is not <emu-xref href="#sec-strict-mode-code" id="_ref_5834"><a href="ecmascript-language-source-code.html#sec-strict-mode-code">strict mode code</a></emu-xref>.</p>
</div></emu-note>
<emu-clause id="sec-directive-prologues-and-the-use-strict-directive">
<h1><span class="secnum">11.2.1</span> Directive Prologues and the Use Strict Directive</h1>
<p>A <dfn id="directive-prologue" variants="Directive Prologues" tabindex="-1">Directive Prologue</dfn> is the longest sequence of <emu-nt id="_ref_19596"><a href="ecmascript-language-statements-and-declarations.html#prod-ExpressionStatement">ExpressionStatement</a></emu-nt>s occurring as the initial <emu-nt id="_ref_19597"><a href="ecmascript-language-statements-and-declarations.html#prod-StatementListItem">StatementListItem</a></emu-nt>s or <emu-nt id="_ref_19598"><a href="ecmascript-language-scripts-and-modules.html#prod-ModuleItem">ModuleItem</a></emu-nt>s of a <emu-nt id="_ref_19599"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>, a <emu-nt id="_ref_19600"><a href="ecmascript-language-scripts-and-modules.html#prod-ScriptBody">ScriptBody</a></emu-nt>, or a <emu-nt id="_ref_19601"><a href="ecmascript-language-scripts-and-modules.html#prod-ModuleBody">ModuleBody</a></emu-nt> and where each <emu-nt id="_ref_19602"><a href="ecmascript-language-statements-and-declarations.html#prod-ExpressionStatement">ExpressionStatement</a></emu-nt> in the sequence consists entirely of a <emu-nt id="_ref_19603"><a href="ecmascript-language-lexical-grammar.html#prod-StringLiteral">StringLiteral</a></emu-nt> token followed by a semicolon. The semicolon may appear explicitly or may be inserted by automatic semicolon insertion (<emu-xref href="#sec-automatic-semicolon-insertion" id="_ref_357"><a href="ecmascript-language-lexical-grammar.html#sec-automatic-semicolon-insertion">12.10</a></emu-xref>). A <emu-xref href="#directive-prologue" id="_ref_5835"><a href="ecmascript-language-source-code.html#directive-prologue">Directive Prologue</a></emu-xref> may be an empty sequence.</p>
<p>A <dfn id="use-strict-directive" variants="Use Strict Directives" tabindex="-1">Use Strict Directive</dfn> is an <emu-nt id="_ref_19604"><a href="ecmascript-language-statements-and-declarations.html#prod-ExpressionStatement">ExpressionStatement</a></emu-nt> in a <emu-xref href="#directive-prologue" id="_ref_5836"><a href="ecmascript-language-source-code.html#directive-prologue">Directive Prologue</a></emu-xref> whose <emu-nt id="_ref_19605"><a href="ecmascript-language-lexical-grammar.html#prod-StringLiteral">StringLiteral</a></emu-nt> is either of the exact code point sequences <code>"use strict"</code> or <code>'use strict'</code>. A <emu-xref href="#use-strict-directive" id="_ref_5837"><a href="ecmascript-language-source-code.html#use-strict-directive">Use Strict Directive</a></emu-xref> may not contain an <emu-nt id="_ref_19606"><a href="ecmascript-language-lexical-grammar.html#prod-EscapeSequence">EscapeSequence</a></emu-nt> or <emu-nt id="_ref_19607"><a href="ecmascript-language-lexical-grammar.html#prod-LineContinuation">LineContinuation</a></emu-nt>.</p>
<p>A <emu-xref href="#directive-prologue" id="_ref_5838"><a href="ecmascript-language-source-code.html#directive-prologue">Directive Prologue</a></emu-xref> may contain more than one <emu-xref href="#use-strict-directive" id="_ref_5839"><a href="ecmascript-language-source-code.html#use-strict-directive">Use Strict Directive</a></emu-xref>. However, an implementation may issue a warning if this occurs.</p>
<emu-note><span class="note">Note</span><div class="note-contents">
<p>The <emu-nt id="_ref_19608"><a href="ecmascript-language-statements-and-declarations.html#prod-ExpressionStatement">ExpressionStatement</a></emu-nt>s of a <emu-xref href="#directive-prologue" id="_ref_5840"><a href="ecmascript-language-source-code.html#directive-prologue">Directive Prologue</a></emu-xref> are evaluated normally during evaluation of the containing production. Implementations may define implementation specific meanings for <emu-nt id="_ref_19609"><a href="ecmascript-language-statements-and-declarations.html#prod-ExpressionStatement">ExpressionStatement</a></emu-nt>s which are not a <emu-xref href="#use-strict-directive" id="_ref_5841"><a href="ecmascript-language-source-code.html#use-strict-directive">Use Strict Directive</a></emu-xref> and which occur in a <emu-xref href="#directive-prologue" id="_ref_5842"><a href="ecmascript-language-source-code.html#directive-prologue">Directive Prologue</a></emu-xref>. If an appropriate notification mechanism exists, an implementation should issue a warning if it encounters in a <emu-xref href="#directive-prologue" id="_ref_5843"><a href="ecmascript-language-source-code.html#directive-prologue">Directive Prologue</a></emu-xref> an <emu-nt id="_ref_19610"><a href="ecmascript-language-statements-and-declarations.html#prod-ExpressionStatement">ExpressionStatement</a></emu-nt> that is not a <emu-xref href="#use-strict-directive" id="_ref_5844"><a href="ecmascript-language-source-code.html#use-strict-directive">Use Strict Directive</a></emu-xref> and which does not have a meaning defined by the implementation.</p>
</div></emu-note>
</emu-clause>
<emu-clause id="sec-strict-mode-code">
<h1><span class="secnum">11.2.2</span> Strict Mode Code</h1>
<p>An ECMAScript syntactic unit may be processed using either unrestricted or strict mode syntax and semantics (<emu-xref href="#sec-strict-variant-of-ecmascript" id="_ref_358"><a href="overview.html#sec-strict-variant-of-ecmascript">4.3.2</a></emu-xref>). Code is interpreted as <dfn tabindex="-1">strict mode code</dfn> in the following situations:</p>
<ul>
<li>
<emu-xref href="#sec-types-of-source-code" id="_ref_5845"><a href="ecmascript-language-source-code.html#sec-types-of-source-code">Global code</a></emu-xref> is strict mode code if it begins with a <emu-xref href="#directive-prologue" id="_ref_5846"><a href="ecmascript-language-source-code.html#directive-prologue">Directive Prologue</a></emu-xref> that contains a <emu-xref href="#use-strict-directive" id="_ref_5847"><a href="ecmascript-language-source-code.html#use-strict-directive">Use Strict Directive</a></emu-xref>.
</li>
<li>
<emu-xref href="#sec-types-of-source-code" id="_ref_5848"><a href="ecmascript-language-source-code.html#sec-types-of-source-code">Module code</a></emu-xref> is always strict mode code.
</li>
<li>
All parts of a <emu-nt id="_ref_19611"><a href="ecmascript-language-functions-and-classes.html#prod-ClassDeclaration">ClassDeclaration</a></emu-nt> or a <emu-nt id="_ref_19612"><a href="ecmascript-language-functions-and-classes.html#prod-ClassExpression">ClassExpression</a></emu-nt> are strict mode code.
</li>
<li>
<emu-xref href="#sec-types-of-source-code" id="_ref_5849"><a href="ecmascript-language-source-code.html#sec-types-of-source-code">Eval code</a></emu-xref> is strict mode code if it begins with a <emu-xref href="#directive-prologue" id="_ref_5850"><a href="ecmascript-language-source-code.html#directive-prologue">Directive Prologue</a></emu-xref> that contains a <emu-xref href="#use-strict-directive" id="_ref_5851"><a href="ecmascript-language-source-code.html#use-strict-directive">Use Strict Directive</a></emu-xref> or if the call to <code>eval</code> is a <emu-xref href="#sec-function-calls-runtime-semantics-evaluation" id="_ref_5852"><a href="ecmascript-language-expressions.html#sec-function-calls-runtime-semantics-evaluation">direct eval</a></emu-xref> that is contained in strict mode code.
</li>
<li>
<emu-xref href="#sec-types-of-source-code" id="_ref_5853"><a href="ecmascript-language-source-code.html#sec-types-of-source-code">Function code</a></emu-xref> is strict mode code if the associated <emu-nt id="_ref_19613"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt>, <emu-nt id="_ref_19614"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionExpression">FunctionExpression</a></emu-nt>, <emu-nt id="_ref_19615"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorDeclaration">GeneratorDeclaration</a></emu-nt>, <emu-nt id="_ref_19616"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorExpression">GeneratorExpression</a></emu-nt>, <emu-nt id="_ref_19617"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionDeclaration">AsyncFunctionDeclaration</a></emu-nt>, <emu-nt id="_ref_19618"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionExpression">AsyncFunctionExpression</a></emu-nt>, <emu-nt id="_ref_19619"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorDeclaration">AsyncGeneratorDeclaration</a></emu-nt>, <emu-nt id="_ref_19620"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorExpression">AsyncGeneratorExpression</a></emu-nt>, <emu-nt id="_ref_19621"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt>, <emu-nt id="_ref_19622"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFunction">ArrowFunction</a></emu-nt>, or <emu-nt id="_ref_19623"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowFunction">AsyncArrowFunction</a></emu-nt> is contained in strict mode code or if the code that produces the value of the function's <var class="field">[[ECMAScriptCode]]</var> internal slot begins with a <emu-xref href="#directive-prologue" id="_ref_5854"><a href="ecmascript-language-source-code.html#directive-prologue">Directive Prologue</a></emu-xref> that contains a <emu-xref href="#use-strict-directive" id="_ref_5855"><a href="ecmascript-language-source-code.html#use-strict-directive">Use Strict Directive</a></emu-xref>.
</li>
<li>
<emu-xref href="#sec-types-of-source-code" id="_ref_5856"><a href="ecmascript-language-source-code.html#sec-types-of-source-code">Function code</a></emu-xref> that is supplied as the arguments to the built-in Function, Generator, AsyncFunction, and AsyncGenerator <emu-xref href="#constructor" id="_ref_5857"><a href="ecmascript-data-types-and-values.html#constructor">constructors</a></emu-xref> is strict mode code if the last argument <emu-xref href="#sec-ecmascript-language-types-string-type" id="_ref_5858"><a href="ecmascript-data-types-and-values.html#sec-ecmascript-language-types-string-type">is a String</a></emu-xref> that when processed is a <emu-nt id="_ref_19624"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt> that begins with a <emu-xref href="#directive-prologue" id="_ref_5859"><a href="ecmascript-language-source-code.html#directive-prologue">Directive Prologue</a></emu-xref> that contains a <emu-xref href="#use-strict-directive" id="_ref_5860"><a href="ecmascript-language-source-code.html#use-strict-directive">Use Strict Directive</a></emu-xref>.
</li>
</ul>
<p>ECMAScript code that is not strict mode code is called <dfn id="non-strict-code" tabindex="-1">non-strict code</dfn>.</p>
<emu-clause id="sec-isstrict" type="abstract operation" aoid="IsStrict">
<h1><span class="secnum">11.2.2.1</span> Static Semantics: IsStrict ( <var>node</var> )</h1>
<p>The abstract operation IsStrict takes argument <var>node</var> (a <emu-xref href="#sec-syntactic-grammar" id="_ref_5861"><a href="notational-conventions.html#sec-syntactic-grammar">Parse Node</a></emu-xref>) and returns a Boolean. It performs the following steps when called:</p>
<emu-alg><ol><li>If the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_5862"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <var>node</var> is <emu-xref href="#sec-strict-mode-code" id="_ref_5863"><a href="ecmascript-language-source-code.html#sec-strict-mode-code">strict mode code</a></emu-xref>, return <emu-val>true</emu-val>.</li><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
</emu-clause>
</emu-clause>
<emu-clause id="sec-non-ecmascript-functions">
<h1><span class="secnum">11.2.3</span> Non-ECMAScript Functions</h1>
<p>An ECMAScript implementation may support the evaluation of function <emu-xref href="#exotic-object" id="_ref_5864"><a href="ecmascript-data-types-and-values.html#exotic-object">exotic objects</a></emu-xref> whose evaluative behaviour is expressed in some <emu-xref href="#host-defined" id="_ref_5865"><a href="overview.html#host-defined">host-defined</a></emu-xref> form of executable code other than <emu-xref href="#sec-source-text" id="_ref_5866"><a href="ecmascript-language-source-code.html#sec-source-text">ECMAScript source text</a></emu-xref>. Whether a <emu-xref href="#function-object" id="_ref_5867"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref> is defined within ECMAScript code or is a built-in function is not observable from the perspective of ECMAScript code that calls or is called by such a <emu-xref href="#function-object" id="_ref_5868"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref>.</p>
</emu-clause>
</emu-clause>
</emu-clause></div></body></html>