From 1959d42c83386eda56098193a93008d594af16e2 Mon Sep 17 00:00:00 2001 From: ptomato <ptomato@users.noreply.github.com> Date: Fri, 19 Apr 2024 17:20:35 +0000 Subject: [PATCH] deploy: 9537dcf4826102511fa007da31d571f68f16f20d --- index.html | 246 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 234 insertions(+), 12 deletions(-) diff --git a/index.html b/index.html index 816ab57..0792cfe 100644 --- a/index.html +++ b/index.html @@ -857,7 +857,9 @@ this.$tableContainer.appendChild(this.$table); this.$pane.appendChild(this.$tableContainer); - menu.$specContainer.appendChild(this.$container); + if (menu != null) { + menu.$specContainer.appendChild(this.$container); + } }, activate() { @@ -1192,6 +1194,9 @@ } function init() { + if (document.getElementById('menu') == null) { + return; + } menu = new Menu(); let $container = document.getElementById('spec-container'); $container.addEventListener( @@ -1871,6 +1876,7 @@ emu-note { margin: 1em 0; display: flex; + gap: 1em; flex-direction: row; color: inherit; border-left: 5px solid #52e052; @@ -1880,8 +1886,7 @@ } emu-note > span.note { - flex-basis: 100px; - min-width: 100px; + white-space: nowrap; flex-grow: 0; flex-shrink: 1; text-transform: uppercase; @@ -2923,12 +2928,6 @@ padding-right: 5px; } -@media print { - #menu-toggle { - display: none; - } -} - [normative-optional], [deprecated], [legacy] { @@ -2986,7 +2985,230 @@ background-color: #eee; box-shadow: inset 0 -1px 0 #ccc; } -</style></head> +</style><style>@media print { +body { + font-family: Arial; + font-size: 10pt; + background: #fff; + color: #000; +} + +.title { + font-family: Verdana; +} + +p { + text-align: justify; + text-rendering: optimizeLegibility; + text-wrap: pretty; + overflow-wrap: break-word; + hyphens: auto; + orphans: 2; + widows: 2; +} + +h1 { + text-wrap: balance; + line-height: 1.4; +} + +emu-note p, +emu-table td p { + text-align: left; + hyphens: manual; + overflow: hidden; +} + +emu-table td, +emu-table th { + overflow-wrap: break-word; +} + +emu-table table { + table-layout: auto; + width: 100%; +} + +emu-figure img { + max-width: 100%; + height: auto; +} + +#spec-container { + max-width: none; +} + +#toc a[href] { + background: #fff; + padding-right: 0.5em; +} +#toc a[href]::after { + content: /* leader(dotted) */ target-counter(attr(href), page); + float: right; + padding-left: 0.5em; + background: #fff; +} +/* NOTE: hacks because Paged.js doesn't support leader() in content directives */ +#toc ol { + overflow-x: hidden; +} +#toc ol li:before { + float: left; + width: 0; + white-space: nowrap; + content: '. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ' + '. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ' + '. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .'; +} + +/* skip the Introduction since it's before the first emu-clause (and therefore doesn't have a proper page number) */ +#toc > ol > li:first-child { + display: none; +} + +#toc, +#spec-container > emu-intro, +#spec-container > emu-annex { + break-before: recto; + break-after: always; +} + +/* according to Ecma guidelines, we're actually not supposed to break before every clause (only the first), but Paged.js fails if we do that */ +/* so instead, just break before any of the clauses that have sub-clauses */ +#spec-container > emu-clause:has(emu-clause:not([example])) { + break-before: always; +} + +#spec-container > emu-clause:first-of-type { + break-before: recto; +} + +emu-note, +emu-note p, +emu-table tr, +emu-table th, +emu-table td, +emu-alg li, +pre, +h1 { + break-inside: avoid; +} + +emu-table thead, +h1, +figcaption, +emu-alg > ol > li:first-child { + break-after: avoid; +} + +emu-grammar + emu-alg, +figcaption + emu-table, +figcaption + span[id] + emu-table, +emu-alg > ol > li:last-child { + break-before: avoid; +} + +a[data-print-href]::after { + content: ' <' attr(href) '>'; + color: initial; +} + +emu-table thead { + display: table-header-group; +} +emu-table tfoot { + display: table-footer-group; +} + +@page { + size: A4; +} + +@page { + @top-center { + content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgcAAAAxCAMAAAB5w/qQAAADAFBMVEX////9/f75+vv6/P76+/z9/v/Q3OPz9/v0+fzx9fn8/P/8/P3y9vrp7/Pn8vj///72+f729/oUFBnQ3OXs8fX4+PrW4ebO3eTu9vv+///e6Ozl8Pb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rbVdkaZESpY03S9t7qFaaFp1jBLV5dFK1Zbl+WU2KSqlR8rOYu0xVZFmzLBGm7rKi/k2mI7r7c657IZx+7VUk6qVPiazp6zeqAPpB/8nSeEfghthuK6gFzCEFQB58bVDDI4VPOBqdKgkL8QwJWEVDRuoaQqQD2+RVBTe6iRwUGsBnLyAaqvA8BJal6x+gcO4fqA2/bx86vavEwygyPpN8lfmEImg32ZR+v+ahT77yZLXWwK/KDcw/KlrFkoZzB/k7fj+tre8nD687RpdopvL3dHP1tnAqn3Fntdnrs4Pt9JB8fZBU3fag+zcRk7PTJmd2nt5Rib+97pPWOnx8/eWbDnnCuXKp/j2qq/d4RQAypzPRhA9/vS0XzCQFVlr9a+2bBkcG4ljYeJBYEYEWSSySBOd7JZTDPLNEWhEDAsCGqR5BWEMiefUJ7peRFNoHVqwkqlsKO2adJBwX3JVQENDhgQkJ4A3DGhbnRA6UdbOLKQFkjAUOEzhDL+O91gpLvu4sMDD+9h7nswiiDhnEKnsfDEXf6pksY808jn+Nq1XflUauxlW7qbnUkvDBxNm1p7ZWD/63S2qCdOpuPBzz2aPg53jC3dpbFKq6ndKGzlZqXSfqnQyTnbPjZhUqpSGPukQcoX/40fqHllGAA3UPwk86A+llQfIJQeQX5A+l/pA9rvQCAmFeAAVMQAeh9usN2jV4KaF0i6SWEDiEV3qaJA1u7JjBRKLxCKQOpEKRTvq7TVq8ePQzQOC10IZHCpQUIq+lw0SHXAfmyAa/x3PJjbzqJhYIqAmbqGhqGbpoHOWIKpgqBpngniRTzLedacqGfZRGbuLwayTNPw1zqe1EL4AGMiy2aDQZNH28z9LBEwGWvjJhwhkMBjgaCKAfydI4QkSEJppDEpjYhKlGcEJW1t7mYH3hxCRFLzCheVr7qPdsnxwgQia5AeraUU4vZOIP5bBVmQpf2SXVy98DOR4FZVe6645tcORENL3PsGebg/fq/Wa04AAAAASUVORK5CYII=); + } +} +@page :first { + @top-center { + content: none; + } +} + +:root { + --page-number-style: decimal; +} + +#toc { + page: toc; +} +@page toc { + --page-number-style: lower-roman; +} +emu-intro { + page: intro; +} +@page intro { + --page-number-style: lower-roman; +} + +#toc { + counter-reset: page 1; +} +#spec-container > emu-clause:first-of-type { + counter-reset: page 1; +} + +@page :left { + @bottom-left { + content: counter(page, var(--page-number-style)); + } +} +@page :right { + @bottom-right { + content: counter(page, var(--page-number-style)); + } +} + +@page :first { + @bottom-left { + content: ''; + } + @bottom-right { + content: ''; + } +} + +}</style><style> + @media print { + @page :left { + @bottom-right { + content: '© Ecma International 2024'; + } + } + @page :right { + @bottom-left { + content: '© Ecma International 2024'; + } + } + @page :first { + @bottom-left { + content: ''; + } + @bottom-right { + content: ''; + } + } + @page :blank { + @bottom-left { + content: ''; + } + @bottom-right { + content: ''; + } + } + } + </style></head> <body><div id="shortcuts-help"> <ul> @@ -2999,7 +3221,7 @@ </ul></div><div id="menu-toggle"><svg xmlns="http://www.w3.org/2000/svg" style="width:100%; height:100%; stroke:currentColor" viewBox="0 0 120 120" width="54" height="54"> <title>Menu</title> <path stroke-width="10" stroke-linecap="round" d="M30,60 h60 M30,30 m0,5 h60 M30,90 m0,-5 h60"></path> - </svg></div><div id="menu-spacer" class="menu-spacer"></div><div id="menu"><div id="menu-search"><input type="text" id="menu-search-box" placeholder="Search..."><div id="menu-search-results" class="inactive"></div></div><div id="menu-pins"><div class="menu-pane-header">Pins<button class="unpin-all">clear</button></div><ul id="menu-pins-list"></ul></div><div class="menu-pane-header">Table of Contents</div><div id="menu-toc"><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-well-known-intrinsic-objects" title="Well-Known intrinsic objects"><span class="secnum">1</span> Well-Known intrinsic objects</a></li><li><span class="item-toggle">+</span><a href="#sec-wrapped-function-exotic-objects" title="Wrapped Function Exotic Objects"><span class="secnum">2</span> Wrapped Function Exotic Objects</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-wrapped-function-exotic-objects-call-thisargument-argumentslist" title="[[Call]] ( thisArgument, argumentsList )"><span class="secnum">2.1</span> <var class="field">[[Call]]</var> ( <var>thisArgument</var>, <var>argumentsList</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-create-type-error-copy" title="CreateTypeErrorCopy ( realmRecord, originalError )"><span class="secnum">2.2</span> CreateTypeErrorCopy ( <var>realmRecord</var>, <var>originalError</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-ordinary-wrapped-function-call" title="OrdinaryWrappedFunctionCall ( F, thisArgument, argumentsList )"><span class="secnum">2.3</span> OrdinaryWrappedFunctionCall ( <var>F</var>, <var>thisArgument</var>, <var>argumentsList</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-prepare-for-wrapped-function-call" title="PrepareForWrappedFunctionCall ( F )"><span class="secnum">2.4</span> PrepareForWrappedFunctionCall ( <var>F</var> )</a></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-shadowrealm-objects" title="ShadowRealm Objects"><span class="secnum">3</span> ShadowRealm Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-shadowrealm-abstracts" title="ShadowRealm Abstract Operations"><span class="secnum">3.1</span> ShadowRealm Abstract Operations</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-wrappedfunctioncreate" title="WrappedFunctionCreate ( callerRealm, Target )"><span class="secnum">3.1.1</span> WrappedFunctionCreate ( <var>callerRealm</var>, <var>Target</var> )</a></li><li><span class="item-toggle">+</span><a href="#sec-copynameandlength" title="CopyNameAndLength ( F, Target [ , prefix [ , argCount ] ] )"><span class="secnum">3.1.2</span> CopyNameAndLength ( <var>F</var>, <var>Target</var> [ , <var>prefix</var> [ , <var>argCount</var> ] ] )</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-function.prototype.bind" title="Function.prototype.bind ( thisArg, ...args )"><span class="secnum">3.1.2.1</span> Function.prototype.bind ( <var>thisArg</var>, ...<var>args</var> )</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-performshadowrealmeval" title="PerformShadowRealmEval ( sourceText, callerRealm, evalRealm )"><span class="secnum">3.1.3</span> PerformShadowRealmEval ( <var>sourceText</var>, <var>callerRealm</var>, <var>evalRealm</var> )</a></li><li><span class="item-toggle">+</span><a href="#sec-shadowrealmimportvalue" title="ShadowRealmImportValue ( specifierString, exportNameString, callerRealm, evalContext )"><span class="secnum">3.1.4</span> ShadowRealmImportValue ( <var>specifierString</var>, <var>exportNameString</var>, <var>callerRealm</var>, <var>evalContext</var> )</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-export-getter-functions" title="ExportGetter functions"><span class="secnum">3.1.4.1</span> ExportGetter functions</a></li><li><span class="item-toggle-none"></span><a href="#sec-import-value-error-functions" title="ImportValueError functions"><span class="secnum">3.1.4.2</span> ImportValueError functions</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-getwrappedvalue" title="GetWrappedValue ( callerRealm, value )"><span class="secnum">3.1.5</span> GetWrappedValue ( <var>callerRealm</var>, <var>value</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-validateshadowrealmobject" title="ValidateShadowRealmObject ( O )"><span class="secnum">3.1.6</span> ValidateShadowRealmObject ( <var>O</var> )</a></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-shadowrealm-constructor" title="The ShadowRealm Constructor"><span class="secnum">3.2</span> The ShadowRealm Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-shadowrealm" title="ShadowRealm ( )"><span class="secnum">3.2.1</span> ShadowRealm ( )</a></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-shadowRealm-constructor" title="Properties of the ShadowRealm Constructor"><span class="secnum">3.3</span> Properties of the ShadowRealm Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-shadowrealm.prototype" title="ShadowRealm.prototype"><span class="secnum">3.3.1</span> ShadowRealm.prototype</a></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-shadowrealm-prototype-object" title="Properties of the ShadowRealm Prototype Object"><span class="secnum">3.4</span> Properties of the ShadowRealm Prototype Object</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-shadowrealm.prototype.evaluate" title="ShadowRealm.prototype.evaluate ( sourceText )"><span class="secnum">3.4.1</span> ShadowRealm.prototype.evaluate ( <var>sourceText</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-shadowrealm.prototype.importvalue" title="ShadowRealm.prototype.importValue ( specifier, exportName )"><span class="secnum">3.4.2</span> ShadowRealm.prototype.importValue ( <var>specifier</var>, <var>exportName</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-shadowrealm.prototype-@@tostringtag" title="ShadowRealm.prototype [ @@toStringTag ]"><span class="secnum">3.4.3</span> ShadowRealm.prototype [ @@toStringTag ]</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-properties-of-shadowrealm-instances" title="Properties of ShadowRealm Instances"><span class="secnum">3.5</span> Properties of ShadowRealm Instances</a></li><li><span class="item-toggle">+</span><a href="#sec-shadowrealm-host-operations" title="Host operations"><span class="secnum">3.6</span> Host operations</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-hostinitializeshadowrealm" title="HostInitializeShadowRealm ( realm )"><span class="secnum">3.6.1</span> HostInitializeShadowRealm ( <var>realm</var> )</a></li></ol></li></ol></li></ol></div></div><div id="spec-container"><h1 class="version">Stage 3 Draft / February 16, 2024</h1><h1 class="title">ShadowRealm API</h1> + </svg></div><div id="menu-spacer" class="menu-spacer"></div><div id="menu"><div id="menu-search"><input type="text" id="menu-search-box" placeholder="Search..."><div id="menu-search-results" class="inactive"></div></div><div id="menu-pins"><div class="menu-pane-header">Pins<button class="unpin-all">clear</button></div><ul id="menu-pins-list"></ul></div><div class="menu-pane-header">Table of Contents</div><div id="menu-toc"><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-well-known-intrinsic-objects" title="Well-Known intrinsic objects"><span class="secnum">1</span> Well-Known intrinsic objects</a></li><li><span class="item-toggle">+</span><a href="#sec-wrapped-function-exotic-objects" title="Wrapped Function Exotic Objects"><span class="secnum">2</span> Wrapped Function Exotic Objects</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-wrapped-function-exotic-objects-call-thisargument-argumentslist" title="[[Call]] ( thisArgument, argumentsList )"><span class="secnum">2.1</span> <var class="field">[[Call]]</var> ( <var>thisArgument</var>, <var>argumentsList</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-create-type-error-copy" title="CreateTypeErrorCopy ( realmRecord, originalError )"><span class="secnum">2.2</span> CreateTypeErrorCopy ( <var>realmRecord</var>, <var>originalError</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-ordinary-wrapped-function-call" title="OrdinaryWrappedFunctionCall ( F, thisArgument, argumentsList )"><span class="secnum">2.3</span> OrdinaryWrappedFunctionCall ( <var>F</var>, <var>thisArgument</var>, <var>argumentsList</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-prepare-for-wrapped-function-call" title="PrepareForWrappedFunctionCall ( F )"><span class="secnum">2.4</span> PrepareForWrappedFunctionCall ( <var>F</var> )</a></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-shadowrealm-objects" title="ShadowRealm Objects"><span class="secnum">3</span> ShadowRealm Objects</a><ol class="toc"><li><span class="item-toggle">+</span><a href="#sec-shadowrealm-abstracts" title="ShadowRealm Abstract Operations"><span class="secnum">3.1</span> ShadowRealm Abstract Operations</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-wrappedfunctioncreate" title="WrappedFunctionCreate ( callerRealm, Target )"><span class="secnum">3.1.1</span> WrappedFunctionCreate ( <var>callerRealm</var>, <var>Target</var> )</a></li><li><span class="item-toggle">+</span><a href="#sec-copynameandlength" title="CopyNameAndLength ( F, Target [ , prefix [ , argCount ] ] )"><span class="secnum">3.1.2</span> CopyNameAndLength ( <var>F</var>, <var>Target</var> [ , <var>prefix</var> [ , <var>argCount</var> ] ] )</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-function.prototype.bind" title="Function.prototype.bind ( thisArg, ...args )"><span class="secnum">3.1.2.1</span> Function.prototype.bind ( <var>thisArg</var>, ...<var>args</var> )</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-performshadowrealmeval" title="PerformShadowRealmEval ( sourceText, callerRealm, evalRealm )"><span class="secnum">3.1.3</span> PerformShadowRealmEval ( <var>sourceText</var>, <var>callerRealm</var>, <var>evalRealm</var> )</a></li><li><span class="item-toggle">+</span><a href="#sec-shadowrealmimportvalue" title="ShadowRealmImportValue ( specifierString, exportNameString, callerRealm, evalContext )"><span class="secnum">3.1.4</span> ShadowRealmImportValue ( <var>specifierString</var>, <var>exportNameString</var>, <var>callerRealm</var>, <var>evalContext</var> )</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-export-getter-functions" title="ExportGetter functions"><span class="secnum">3.1.4.1</span> ExportGetter functions</a></li><li><span class="item-toggle-none"></span><a href="#sec-import-value-error-functions" title="ImportValueError functions"><span class="secnum">3.1.4.2</span> ImportValueError functions</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-getwrappedvalue" title="GetWrappedValue ( callerRealm, value )"><span class="secnum">3.1.5</span> GetWrappedValue ( <var>callerRealm</var>, <var>value</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-validateshadowrealmobject" title="ValidateShadowRealmObject ( O )"><span class="secnum">3.1.6</span> ValidateShadowRealmObject ( <var>O</var> )</a></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-shadowrealm-constructor" title="The ShadowRealm Constructor"><span class="secnum">3.2</span> The ShadowRealm Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-shadowrealm" title="ShadowRealm ( )"><span class="secnum">3.2.1</span> ShadowRealm ( )</a></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-shadowRealm-constructor" title="Properties of the ShadowRealm Constructor"><span class="secnum">3.3</span> Properties of the ShadowRealm Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-shadowrealm.prototype" title="ShadowRealm.prototype"><span class="secnum">3.3.1</span> ShadowRealm.prototype</a></li></ol></li><li><span class="item-toggle">+</span><a href="#sec-properties-of-the-shadowrealm-prototype-object" title="Properties of the ShadowRealm Prototype Object"><span class="secnum">3.4</span> Properties of the ShadowRealm Prototype Object</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-shadowrealm.prototype.evaluate" title="ShadowRealm.prototype.evaluate ( sourceText )"><span class="secnum">3.4.1</span> ShadowRealm.prototype.evaluate ( <var>sourceText</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-shadowrealm.prototype.importvalue" title="ShadowRealm.prototype.importValue ( specifier, exportName )"><span class="secnum">3.4.2</span> ShadowRealm.prototype.importValue ( <var>specifier</var>, <var>exportName</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-shadowrealm.prototype-@@tostringtag" title="ShadowRealm.prototype [ @@toStringTag ]"><span class="secnum">3.4.3</span> ShadowRealm.prototype [ @@toStringTag ]</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-properties-of-shadowrealm-instances" title="Properties of ShadowRealm Instances"><span class="secnum">3.5</span> Properties of ShadowRealm Instances</a></li><li><span class="item-toggle">+</span><a href="#sec-shadowrealm-host-operations" title="Host operations"><span class="secnum">3.6</span> Host operations</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-hostinitializeshadowrealm" title="HostInitializeShadowRealm ( realm )"><span class="secnum">3.6.1</span> HostInitializeShadowRealm ( <var>realm</var> )</a></li></ol></li></ol></li></ol></div></div><div id="spec-container"><h1 class="version">Stage 3 Draft / April 19, 2024</h1><h1 class="title">ShadowRealm API</h1> <emu-clause id="sec-well-known-intrinsic-objects"> @@ -3145,7 +3367,7 @@ <h1><span class="secnum">3.1.2.1</span> Function.prototype.bind ( <var>thisArg</ <emu-clause id="sec-performshadowrealmeval" type="abstract operation" aoid="PerformShadowRealmEval"> <h1><span class="secnum">3.1.3</span> PerformShadowRealmEval ( <var>sourceText</var>, <var>callerRealm</var>, <var>evalRealm</var> )</h1> <p>The abstract operation PerformShadowRealmEval takes arguments <var>sourceText</var> (a String), <var>callerRealm</var> (a <emu-xref href="#realm-record"><a href="https://tc39.es/ecma262/#realm-record">Realm Record</a></emu-xref>), and <var>evalRealm</var> (a <emu-xref href="#realm-record"><a href="https://tc39.es/ecma262/#realm-record">Realm Record</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> either a primitive value or a <emu-xref href="#wrapped-function-exotic-object" id="_ref_27"><a href="#wrapped-function-exotic-object">wrapped function exotic object</a></emu-xref>, or a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">throw completion</a></emu-xref>. ... It performs the following steps when called:</p> - <emu-alg><ol><li>Perform ? <emu-xref aoid="HostEnsureCanCompileStrings"><a href="https://tc39.es/ecma262/#sec-hostensurecancompilestrings">HostEnsureCanCompileStrings</a></emu-xref>(<var>evalRealm</var>, « », <var>sourceText</var>, <emu-val>false</emu-val>).</li><li>Perform the following substeps in an <emu-xref href="#implementation-defined"><a href="https://tc39.es/ecma262/#implementation-defined">implementation-defined</a></emu-xref> order, possibly interleaving parsing and error detection:<ol><li>Let <var>script</var> be <emu-xref aoid="ParseText"><a href="https://tc39.es/ecma262/#sec-parsetext">ParseText</a></emu-xref>(<emu-xref aoid="StringToCodePoints"><a href="https://tc39.es/ecma262/#sec-stringtocodepoints">StringToCodePoints</a></emu-xref>(<var>sourceText</var>), <emu-nt><a href="https://tc39.es/ecma262/#prod-Script">Script</a></emu-nt>).</li><li>If <var>script</var> is a <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> of errors, throw a <emu-val>SyntaxError</emu-val> exception.</li><li>If <var>script</var> <emu-xref aoid="Contains"><a href="https://tc39.es/ecma262/#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt><a href="https://tc39.es/ecma262/#prod-ScriptBody">ScriptBody</a></emu-nt> is <emu-val>false</emu-val>, return <emu-val>undefined</emu-val>.</li><li>Let <var>body</var> be the <emu-nt><a href="https://tc39.es/ecma262/#prod-ScriptBody">ScriptBody</a></emu-nt> of <var>script</var>.</li><li>If <var>body</var> <emu-xref aoid="Contains"><a href="https://tc39.es/ecma262/#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt><a href="https://tc39.es/ecma262/#prod-NewTarget">NewTarget</a></emu-nt> is <emu-val>true</emu-val>, throw a <emu-val>SyntaxError</emu-val> exception.</li><li>If <var>body</var> <emu-xref aoid="Contains"><a href="https://tc39.es/ecma262/#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt><a href="https://tc39.es/ecma262/#prod-SuperProperty">SuperProperty</a></emu-nt> is <emu-val>true</emu-val>, throw a <emu-val>SyntaxError</emu-val> exception.</li><li>If <var>body</var> <emu-xref aoid="Contains"><a href="https://tc39.es/ecma262/#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt><a href="https://tc39.es/ecma262/#prod-SuperCall">SuperCall</a></emu-nt> is <emu-val>true</emu-val>, throw a <emu-val>SyntaxError</emu-val> exception.</li></ol></li><li>Let <var>strictEval</var> be <emu-xref aoid="IsStrict"><a href="https://tc39.es/ecma262/#sec-static-semantics-isstrict">IsStrict</a></emu-xref> of <var>script</var>.</li><li>Let <var>runningContext</var> be the <emu-xref href="#running-execution-context"><a href="https://tc39.es/ecma262/#running-execution-context">running execution context</a></emu-xref>.</li><li>Let <var>lexEnv</var> be <emu-xref aoid="NewDeclarativeEnvironment"><a href="https://tc39.es/ecma262/#sec-newdeclarativeenvironment">NewDeclarativeEnvironment</a></emu-xref>(<var>evalRealm</var>.<var class="field">[[GlobalEnv]]</var>).</li><li>Let <var>varEnv</var> be <var>evalRealm</var>.<var class="field">[[GlobalEnv]]</var>.</li><li>If <var>strictEval</var> is <emu-val>true</emu-val>, set <var>varEnv</var> to <var>lexEnv</var>.</li><li>If <var>runningContext</var> is not already suspended, suspend <var>runningContext</var>.</li><li>Let <var>evalContext</var> be a new <emu-xref href="#ecmascript-code-execution-context"><a href="https://tc39.es/ecma262/#ecmascript-code-execution-context">ECMAScript code execution context</a></emu-xref>.</li><li>Set <var>evalContext</var>'s Function to <emu-val>null</emu-val>.</li><li>Set <var>evalContext</var>'s <emu-xref href="#realm"><a href="https://tc39.es/ecma262/#realm">Realm</a></emu-xref> to <var>evalRealm</var>.</li><li>Set <var>evalContext</var>'s ScriptOrModule to <emu-val>null</emu-val>.</li><li>Set <var>evalContext</var>'s VariableEnvironment to <var>varEnv</var>.</li><li>Set <var>evalContext</var>'s LexicalEnvironment to <var>lexEnv</var>.</li><li>Set <var>evalContext</var>'s PrivateEnvironment to <emu-val>null</emu-val>.</li><li>Push <var>evalContext</var> onto the <emu-xref href="#execution-context-stack"><a href="https://tc39.es/ecma262/#execution-context-stack">execution context stack</a></emu-xref>; <var>evalContext</var> is now the <emu-xref href="#running-execution-context"><a href="https://tc39.es/ecma262/#running-execution-context">running execution context</a></emu-xref>.</li><li>Let <var>result</var> be <emu-xref aoid="Completion"><a href="https://tc39.es/ecma262/#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="EvalDeclarationInstantiation"><a href="https://tc39.es/ecma262/#sec-evaldeclarationinstantiation">EvalDeclarationInstantiation</a></emu-xref>(<var>body</var>, <var>varEnv</var>, <var>lexEnv</var>, <emu-val>null</emu-val>, <var>strictEval</var>)).</li><li>If <var>result</var>.<var class="field">[[Type]]</var> is <emu-const>normal</emu-const>, then<ol><li>Set <var>result</var> to <emu-xref aoid="Completion"><a href="https://tc39.es/ecma262/#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation">Evaluation</a></emu-xref> of <var>body</var>).</li></ol></li><li>If <var>result</var>.<var class="field">[[Type]]</var> is <emu-const>normal</emu-const> and <var>result</var>.<var class="field">[[Value]]</var> is <emu-const>empty</emu-const>, then<ol><li>Set <var>result</var> to <emu-xref aoid="NormalCompletion"><a href="https://tc39.es/ecma262/#sec-normalcompletion">NormalCompletion</a></emu-xref>(<emu-val>undefined</emu-val>).</li></ol></li><li>Suspend <var>evalContext</var> and remove it from the <emu-xref href="#execution-context-stack"><a href="https://tc39.es/ecma262/#execution-context-stack">execution context stack</a></emu-xref>.</li><li>Resume the context that is now on the top of the <emu-xref href="#execution-context-stack"><a href="https://tc39.es/ecma262/#execution-context-stack">execution context stack</a></emu-xref> as the <emu-xref href="#running-execution-context"><a href="https://tc39.es/ecma262/#running-execution-context">running execution context</a></emu-xref>.</li><li>If <var>result</var>.<var class="field">[[Type]]</var> is not <emu-const>normal</emu-const>, then<ol><li>Let <var>copiedError</var> be <emu-xref aoid="CreateTypeErrorCopy" id="_ref_28"><a href="#sec-create-type-error-copy">CreateTypeErrorCopy</a></emu-xref>(<var>callerRealm</var>, <var>result</var>.<var class="field">[[Value]]</var>).</li><li>Return <emu-xref aoid="ThrowCompletion"><a href="https://tc39.es/ecma262/#sec-throwcompletion">ThrowCompletion</a></emu-xref>(<var>copiedError</var>).</li></ol></li><li>Return ? <emu-xref aoid="GetWrappedValue" id="_ref_29"><a href="#sec-getwrappedvalue">GetWrappedValue</a></emu-xref>(<var>callerRealm</var>, <var>result</var>.<var class="field">[[Value]]</var>).</li></ol></emu-alg> + <emu-alg><ol><li>Perform ? <emu-xref aoid="HostEnsureCanCompileStrings"><a href="https://tc39.es/ecma262/#sec-hostensurecancompilestrings">HostEnsureCanCompileStrings</a></emu-xref>(<var>evalRealm</var>, « », <var>sourceText</var>, <emu-val>false</emu-val>).</li><li>Perform the following substeps in an <emu-xref href="#implementation-defined"><a href="https://tc39.es/ecma262/#implementation-defined">implementation-defined</a></emu-xref> order, possibly interleaving parsing and error detection:<ol><li>Let <var>script</var> be <emu-xref aoid="ParseText"><a href="https://tc39.es/ecma262/#sec-parsetext">ParseText</a></emu-xref>(<emu-xref aoid="StringToCodePoints"><a href="https://tc39.es/ecma262/#sec-stringtocodepoints">StringToCodePoints</a></emu-xref>(<var>sourceText</var>), <emu-nt><a href="https://tc39.es/ecma262/#prod-Script">Script</a></emu-nt>).</li><li>If <var>script</var> is a <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> of errors, throw a <emu-val>SyntaxError</emu-val> exception.</li><li>If <var>script</var> <emu-xref aoid="Contains"><a href="https://tc39.es/ecma262/#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt><a href="https://tc39.es/ecma262/#prod-ScriptBody">ScriptBody</a></emu-nt> is <emu-val>false</emu-val>, return <emu-val>undefined</emu-val>.</li><li>Let <var>body</var> be the <emu-nt><a href="https://tc39.es/ecma262/#prod-ScriptBody">ScriptBody</a></emu-nt> of <var>script</var>.</li><li>If <var>body</var> <emu-xref aoid="Contains"><a href="https://tc39.es/ecma262/#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt><a href="https://tc39.es/ecma262/#prod-NewTarget">NewTarget</a></emu-nt> is <emu-val>true</emu-val>, throw a <emu-val>SyntaxError</emu-val> exception.</li><li>If <var>body</var> <emu-xref aoid="Contains"><a href="https://tc39.es/ecma262/#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt><a href="https://tc39.es/ecma262/#prod-SuperProperty">SuperProperty</a></emu-nt> is <emu-val>true</emu-val>, throw a <emu-val>SyntaxError</emu-val> exception.</li><li>If <var>body</var> <emu-xref aoid="Contains"><a href="https://tc39.es/ecma262/#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt><a href="https://tc39.es/ecma262/#prod-SuperCall">SuperCall</a></emu-nt> is <emu-val>true</emu-val>, throw a <emu-val>SyntaxError</emu-val> exception.</li></ol></li><li>Let <var>strictEval</var> be <emu-xref aoid="ScriptIsStrict"><a href="https://tc39.es/ecma262/#sec-scriptisstrict">ScriptIsStrict</a></emu-xref> of <var>script</var>.</li><li>Let <var>runningContext</var> be the <emu-xref href="#running-execution-context"><a href="https://tc39.es/ecma262/#running-execution-context">running execution context</a></emu-xref>.</li><li>Let <var>lexEnv</var> be <emu-xref aoid="NewDeclarativeEnvironment"><a href="https://tc39.es/ecma262/#sec-newdeclarativeenvironment">NewDeclarativeEnvironment</a></emu-xref>(<var>evalRealm</var>.<var class="field">[[GlobalEnv]]</var>).</li><li>Let <var>varEnv</var> be <var>evalRealm</var>.<var class="field">[[GlobalEnv]]</var>.</li><li>If <var>strictEval</var> is <emu-val>true</emu-val>, set <var>varEnv</var> to <var>lexEnv</var>.</li><li>If <var>runningContext</var> is not already suspended, suspend <var>runningContext</var>.</li><li>Let <var>evalContext</var> be a new <emu-xref href="#ecmascript-code-execution-context"><a href="https://tc39.es/ecma262/#ecmascript-code-execution-context">ECMAScript code execution context</a></emu-xref>.</li><li>Set <var>evalContext</var>'s Function to <emu-val>null</emu-val>.</li><li>Set <var>evalContext</var>'s <emu-xref href="#realm"><a href="https://tc39.es/ecma262/#realm">Realm</a></emu-xref> to <var>evalRealm</var>.</li><li>Set <var>evalContext</var>'s ScriptOrModule to <emu-val>null</emu-val>.</li><li>Set <var>evalContext</var>'s VariableEnvironment to <var>varEnv</var>.</li><li>Set <var>evalContext</var>'s LexicalEnvironment to <var>lexEnv</var>.</li><li>Set <var>evalContext</var>'s PrivateEnvironment to <emu-val>null</emu-val>.</li><li>Push <var>evalContext</var> onto the <emu-xref href="#execution-context-stack"><a href="https://tc39.es/ecma262/#execution-context-stack">execution context stack</a></emu-xref>; <var>evalContext</var> is now the <emu-xref href="#running-execution-context"><a href="https://tc39.es/ecma262/#running-execution-context">running execution context</a></emu-xref>.</li><li>Let <var>result</var> be <emu-xref aoid="Completion"><a href="https://tc39.es/ecma262/#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="EvalDeclarationInstantiation"><a href="https://tc39.es/ecma262/#sec-evaldeclarationinstantiation">EvalDeclarationInstantiation</a></emu-xref>(<var>body</var>, <var>varEnv</var>, <var>lexEnv</var>, <emu-val>null</emu-val>, <var>strictEval</var>)).</li><li>If <var>result</var>.<var class="field">[[Type]]</var> is <emu-const>normal</emu-const>, then<ol><li>Set <var>result</var> to <emu-xref aoid="Completion"><a href="https://tc39.es/ecma262/#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="Evaluation"><a href="https://tc39.es/ecma262/#sec-evaluation">Evaluation</a></emu-xref> of <var>body</var>).</li></ol></li><li>If <var>result</var>.<var class="field">[[Type]]</var> is <emu-const>normal</emu-const> and <var>result</var>.<var class="field">[[Value]]</var> is <emu-const>empty</emu-const>, then<ol><li>Set <var>result</var> to <emu-xref aoid="NormalCompletion"><a href="https://tc39.es/ecma262/#sec-normalcompletion">NormalCompletion</a></emu-xref>(<emu-val>undefined</emu-val>).</li></ol></li><li>Suspend <var>evalContext</var> and remove it from the <emu-xref href="#execution-context-stack"><a href="https://tc39.es/ecma262/#execution-context-stack">execution context stack</a></emu-xref>.</li><li>Resume the context that is now on the top of the <emu-xref href="#execution-context-stack"><a href="https://tc39.es/ecma262/#execution-context-stack">execution context stack</a></emu-xref> as the <emu-xref href="#running-execution-context"><a href="https://tc39.es/ecma262/#running-execution-context">running execution context</a></emu-xref>.</li><li>If <var>result</var>.<var class="field">[[Type]]</var> is not <emu-const>normal</emu-const>, then<ol><li>Let <var>copiedError</var> be <emu-xref aoid="CreateTypeErrorCopy" id="_ref_28"><a href="#sec-create-type-error-copy">CreateTypeErrorCopy</a></emu-xref>(<var>callerRealm</var>, <var>result</var>.<var class="field">[[Value]]</var>).</li><li>Return <emu-xref aoid="ThrowCompletion"><a href="https://tc39.es/ecma262/#sec-throwcompletion">ThrowCompletion</a></emu-xref>(<var>copiedError</var>).</li></ol></li><li>Return ? <emu-xref aoid="GetWrappedValue" id="_ref_29"><a href="#sec-getwrappedvalue">GetWrappedValue</a></emu-xref>(<var>callerRealm</var>, <var>result</var>.<var class="field">[[Value]]</var>).</li></ol></emu-alg> <emu-note type="editor"><span class="note">Editor's Note</span><div class="note-contents"> In the case of an abrupt <emu-const>throw</emu-const> completion, the type of error to be created should match the type of the abrupt <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">throw completion</a></emu-xref> record. This could be revisited when merging into the main specification. Additionally, in the case of a <emu-const>break</emu-const> or <emu-const>continue</emu-const> completion, since those are not supported, a TypeError is expected. There should be no <emu-const>return</emu-const> completion because this is a top level script evaluation, in which case a return <emu-nt><a href="https://tc39.es/ecma262/#prod-Statement">Statement</a></emu-nt> must result in a parsing error. </div></emu-note>