diff --git a/index.html b/index.html
index 6dfa0f4..77715ee 100644
--- a/index.html
+++ b/index.html
@@ -2999,7 +2999,7 @@
Stage 3 Draft / November 20, 2024
Dynamic Code Brand Checks
+ Stage 3 Draft / November 27, 2024
Dynamic Code Brand Checks
1 HostGetCodeForEval ( argument )
@@ -3030,7 +3030,7 @@ 2 HostEnsureCanCompileStrings ( calleeRealm
3 PerformEval ( x, strictCaller, direct )
The abstract operation PerformEval takes arguments x (an ECMAScript language value), strictCaller (a Boolean), and direct (direct-eval or indirect-eval) and returns either a normal completion containing an ECMAScript language value or a throw completion. It performs the following steps when called:
-- Assert: If direct is indirect-eval, then strictCaller is also false.
- If x is a String, then
- Let xStr be x.
- Else if x is an Object, then
- Let code be HostGetCodeForEval(x).
- If code is a String, let xStr be code.
- Else, return x.
- Else,
- Return x.
If x is not a String, return x.- Let evalRealm be the current Realm Record.
- NOTE: In the case of a direct eval, evalRealm is the realm of both the caller of
eval
and of the eval
function itself. - Perform ? HostEnsureCanCompileStrings(evalRealm, « »,
x xStr, xStr, direct, « », x).
- ...
+- Assert: If direct is indirect-eval, then strictCaller is also false.
- If x is a String, then
- Let xStr be x.
- Else if x is an Object, then
- Let code be HostGetCodeForEval(x).
- If code is a String, let xStr be code.
- Else, return x.
- Else,
- Return x.
If x is not a String, return x.- Let evalRealm be the current Realm Record.
- NOTE: In the case of a direct eval, evalRealm is the realm of both the caller of
eval
and of the eval
function itself. - Perform ? HostEnsureCanCompileStrings(evalRealm, « »,
x xStr, xStr, direct, « », x).
- Let inFunction be false.
- Let inMethod be false.
- Let inDerivedConstructor be false.
- Let inClassFieldInitializer be false.
- If direct is direct-eval, then
- Let thisEnvRec be GetThisEnvironment().
- If thisEnvRec is a Function Environment Record, then
- Let F be thisEnvRec.[[FunctionObject]].
- Set inFunction to true.
- Set inMethod to thisEnvRec.HasSuperBinding().
- If F.[[ConstructorKind]] is derived, set inDerivedConstructor to true.
- Let classFieldInitializerName be F.[[ClassFieldInitializerName]].
- If classFieldInitializerName is not empty, set inClassFieldInitializer to true.
- Perform the following substeps in an implementation-defined order, possibly interleaving parsing and error detection:
- Let script be ParseText(
x xStr, Script).
- ...
diff --git a/spec.emu b/spec.emu
index d34a8e6..5218f9c 100644
--- a/spec.emu
+++ b/spec.emu
@@ -81,6 +81,21 @@ contributors: Krzysztof Kotowicz, Mike Samuel, Luke Warlow
1. Let _evalRealm_ be the current Realm Record.
1. NOTE: In the case of a direct eval, _evalRealm_ is the realm of both the caller of `eval` and of the `eval` function itself.
1. Perform ? HostEnsureCanCompileStrings(_evalRealm_, « », _x_ _xStr_, _xStr_, _direct_, « », _x_).
+ 1. Let _inFunction_ be *false*.
+ 1. Let _inMethod_ be *false*.
+ 1. Let _inDerivedConstructor_ be *false*.
+ 1. Let _inClassFieldInitializer_ be *false*.
+ 1. If _direct_ is ~direct-eval~, then
+ 1. Let _thisEnvRec_ be GetThisEnvironment().
+ 1. If _thisEnvRec_ is a Function Environment Record, then
+ 1. Let _F_ be _thisEnvRec_.[[FunctionObject]].
+ 1. Set _inFunction_ to *true*.
+ 1. Set _inMethod_ to _thisEnvRec_.HasSuperBinding().
+ 1. If _F_.[[ConstructorKind]] is ~derived~, set _inDerivedConstructor_ to *true*.
+ 1. Let _classFieldInitializerName_ be _F_.[[ClassFieldInitializerName]].
+ 1. If _classFieldInitializerName_ is not ~empty~, set _inClassFieldInitializer_ to *true*.
+ 1. Perform the following substeps in an implementation-defined order, possibly interleaving parsing and error detection:
+ 1. Let _script_ be ParseText(_x_ _xStr_, |Script|).
1. ...