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; } - +

Stage 3 Draft / February 16, 2024

ShadowRealm API

+

Stage 3 Draft / April 19, 2024

ShadowRealm API

@@ -3145,7 +3367,7 @@

3.1.2.1 Function.prototype.bind ( thisArg

3.1.3 PerformShadowRealmEval ( sourceText, callerRealm, evalRealm )

The abstract operation PerformShadowRealmEval takes arguments sourceText (a String), callerRealm (a Realm Record), and evalRealm (a Realm Record) and returns either a normal completion containing either a primitive value or a wrapped function exotic object, or a throw completion. ... It performs the following steps when called:

-
  1. Perform ? HostEnsureCanCompileStrings(evalRealm, « », sourceText, false).
  2. Perform the following substeps in an implementation-defined order, possibly interleaving parsing and error detection:
    1. Let script be ParseText(StringToCodePoints(sourceText), Script).
    2. If script is a List of errors, throw a SyntaxError exception.
    3. If script Contains ScriptBody is false, return undefined.
    4. Let body be the ScriptBody of script.
    5. If body Contains NewTarget is true, throw a SyntaxError exception.
    6. If body Contains SuperProperty is true, throw a SyntaxError exception.
    7. If body Contains SuperCall is true, throw a SyntaxError exception.
  3. Let strictEval be IsStrict of script.
  4. Let runningContext be the running execution context.
  5. Let lexEnv be NewDeclarativeEnvironment(evalRealm.[[GlobalEnv]]).
  6. Let varEnv be evalRealm.[[GlobalEnv]].
  7. If strictEval is true, set varEnv to lexEnv.
  8. If runningContext is not already suspended, suspend runningContext.
  9. Let evalContext be a new ECMAScript code execution context.
  10. Set evalContext's Function to null.
  11. Set evalContext's Realm to evalRealm.
  12. Set evalContext's ScriptOrModule to null.
  13. Set evalContext's VariableEnvironment to varEnv.
  14. Set evalContext's LexicalEnvironment to lexEnv.
  15. Set evalContext's PrivateEnvironment to null.
  16. Push evalContext onto the execution context stack; evalContext is now the running execution context.
  17. Let result be Completion(EvalDeclarationInstantiation(body, varEnv, lexEnv, null, strictEval)).
  18. If result.[[Type]] is normal, then
    1. Set result to Completion(Evaluation of body).
  19. If result.[[Type]] is normal and result.[[Value]] is empty, then
    1. Set result to NormalCompletion(undefined).
  20. Suspend evalContext and remove it from the execution context stack.
  21. Resume the context that is now on the top of the execution context stack as the running execution context.
  22. If result.[[Type]] is not normal, then
    1. Let copiedError be CreateTypeErrorCopy(callerRealm, result.[[Value]]).
    2. Return ThrowCompletion(copiedError).
  23. Return ? GetWrappedValue(callerRealm, result.[[Value]]).
+
  1. Perform ? HostEnsureCanCompileStrings(evalRealm, « », sourceText, false).
  2. Perform the following substeps in an implementation-defined order, possibly interleaving parsing and error detection:
    1. Let script be ParseText(StringToCodePoints(sourceText), Script).
    2. If script is a List of errors, throw a SyntaxError exception.
    3. If script Contains ScriptBody is false, return undefined.
    4. Let body be the ScriptBody of script.
    5. If body Contains NewTarget is true, throw a SyntaxError exception.
    6. If body Contains SuperProperty is true, throw a SyntaxError exception.
    7. If body Contains SuperCall is true, throw a SyntaxError exception.
  3. Let strictEval be ScriptIsStrict of script.
  4. Let runningContext be the running execution context.
  5. Let lexEnv be NewDeclarativeEnvironment(evalRealm.[[GlobalEnv]]).
  6. Let varEnv be evalRealm.[[GlobalEnv]].
  7. If strictEval is true, set varEnv to lexEnv.
  8. If runningContext is not already suspended, suspend runningContext.
  9. Let evalContext be a new ECMAScript code execution context.
  10. Set evalContext's Function to null.
  11. Set evalContext's Realm to evalRealm.
  12. Set evalContext's ScriptOrModule to null.
  13. Set evalContext's VariableEnvironment to varEnv.
  14. Set evalContext's LexicalEnvironment to lexEnv.
  15. Set evalContext's PrivateEnvironment to null.
  16. Push evalContext onto the execution context stack; evalContext is now the running execution context.
  17. Let result be Completion(EvalDeclarationInstantiation(body, varEnv, lexEnv, null, strictEval)).
  18. If result.[[Type]] is normal, then
    1. Set result to Completion(Evaluation of body).
  19. If result.[[Type]] is normal and result.[[Value]] is empty, then
    1. Set result to NormalCompletion(undefined).
  20. Suspend evalContext and remove it from the execution context stack.
  21. Resume the context that is now on the top of the execution context stack as the running execution context.
  22. If result.[[Type]] is not normal, then
    1. Let copiedError be CreateTypeErrorCopy(callerRealm, result.[[Value]]).
    2. Return ThrowCompletion(copiedError).
  23. Return ? GetWrappedValue(callerRealm, result.[[Value]]).
Editor's Note
In the case of an abrupt throw completion, the type of error to be created should match the type of the abrupt throw completion record. This could be revisited when merging into the main specification. Additionally, in the case of a break or continue completion, since those are not supported, a TypeError is expected. There should be no return completion because this is a top level script evaluation, in which case a return Statement must result in a parsing error.