You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>The HasBinding concrete method of a declarative Environment Record _envRec_ takes argument _N_ (a String). It determines if the argument identifier is one of the identifiers bound by the record. It performs the following steps when called:</p>
8546
8632
<emu-alg>
8547
-
1. If _envRec_.[[Bindings]] contains a binding for the name that is the value of _N_, return *true*.
8633
+
1. If _envRec_.[[Bindings]] contains a DeclarativeBindingRecord whose [[BoundName]] field is equal to the value of _N_, return *true*.
<p>The CreateMutableBinding concrete method of a declarative Environment Record _envRec_ takes arguments _N_ (a String) and _D_ (a Boolean). It creates a new mutable binding for the name _N_ that is uninitialized. A binding must not already exist in this Environment Record for _N_. If _D_ has the value *true*, the new binding is marked as being subject to deletion. It performs the following steps when called:</p>
8555
8641
<emu-alg>
8556
8642
1. Assert: _envRec_.HasBinding(_N_) is *false*.
8557
-
1. Let _binding_ be a mutable binding for _N_ and record that it is uninitialized. If _D_ is *true*, record that the newly created binding may be deleted by a subsequent DeleteBinding call.
8643
+
1. Let _binding_ be DeclarativeBindingRecord { [[BoundName]]: _N_, [[IsInitialized]]: *false*, [[BoundValue]]: *undefined*, [[IsMutable]]: *true*, [[IsDeletable]]: _D_, [[IsStrict]]: *false* }.
<p>The CreateImmutableBinding concrete method of a declarative Environment Record _envRec_ takes arguments _N_ (a String) and _S_ (a Boolean). It creates a new immutable binding for the name _N_ that is uninitialized. A binding must not already exist in this Environment Record for _N_. If _S_ has the value *true*, the new binding is marked as a strict binding. It performs the following steps when called:</p>
8566
8652
<emu-alg>
8567
8653
1. Assert: _envRec_.HasBinding(_N_) is *false*.
8568
-
1. Let _binding_ be an immutable binding for _N_ and record that it is uninitialized. If _S_ is *true*, record that the newly created binding is a strict binding.
8654
+
1. Let _binding_ be DeclarativeBindingRecord { [[BoundName]]: _N_, [[IsInitialized]]: *false*, [[BoundValue]]: *undefined*, [[IsMutable]]: *false*, [[IsDeletable]]: *false*, [[IsStrict]]: _S_ }.
<p>The InitializeBinding concrete method of a declarative Environment Record _envRec_ takes arguments _N_ (a String) and _V_ (an ECMAScript language value). It is used to set the bound value of the current binding of the identifier whose name is the value of the argument _N_ to the value of argument _V_. An uninitialized binding for _N_ must already exist. It performs the following steps when called:</p>
8577
8663
<emu-alg>
8578
8664
1. Assert: _envRec_.HasBinding(_N_) is *true*.
8579
-
1. Let _binding_ be the binding for _N_ in _envRec_.[[Bindings]].
8580
-
1. Assert: _binding_ is uninitialized.
8581
-
1. Set the bound value of _binding_ to _V_.
8582
-
1. <emu-not-ref>Record</emu-not-ref> that _binding_ has been initialized.
8665
+
1. Let _binding_ be the DeclarativeBindingRecord in _envRec_.[[Bindings]] whose [[BoundName]] field equals _N_.
8666
+
1. Assert: _binding_.[[IsInitialized]] is *false*.
<p>The GetBindingValue concrete method of a declarative Environment Record _envRec_ takes arguments _N_ (a String) and _S_ (a Boolean). It returns the value of its bound identifier whose name is the value of the argument _N_. If the binding exists but is uninitialized a *ReferenceError* is thrown, regardless of the value of _S_. It performs the following steps when called:</p>
8614
8700
<emu-alg>
8615
8701
1. Assert: _envRec_.HasBinding(_N_) is *true*.
8616
-
1. Let _binding_ be the binding for _N_ in _envRec_.[[Bindings]].
8617
-
1. If _binding_ is an uninitialized binding, throw a *ReferenceError* exception.
8618
-
1. Return the value currently bound in _binding_.
8702
+
1. Let _binding_ be the DeclarativeBindingRecord in _envRec_.[[Bindings]] whose [[BoundName]] field equals _N_.
8703
+
1. If _binding_.[[IsInitialized]] is *false*, throw a *ReferenceError* exception.
<p>The DeleteBinding concrete method of a declarative Environment Record _envRec_ takes argument _N_ (a String). It can only delete bindings that have been explicitly designated as being subject to deletion. It performs the following steps when called:</p>
8625
8711
<emu-alg>
8626
8712
1. Assert: _envRec_.HasBinding(_N_) is *true*.
8627
-
1. Let _binding_ be the binding for _N_ in _envRec_.[[Bindings]].
8628
-
1. If _binding_ cannot be deleted, return *false*.
8713
+
1. Let _binding_ be the DeclarativeBindingRecord in _envRec_.[[Bindings]] whose [[BoundName]] field equals _N_.
8714
+
1. If _binding_.[[IsDeletable]] is *false*, return *false*.
<p>The [[Bindings]] of a Module Environment Record can include ImportDeclarativeBindingRecords. These have all the fields of DeclarativeBindingRecords, plus the additional state fields listed in the following table.</p>
9433
+
<emu-table id="table-additional-fields-of-importdeclarativebindingrecords" caption="Additional Fields of ImportDeclarativeBindingRecords">
9434
+
<table>
9435
+
<tbody>
9436
+
<tr>
9437
+
<th>
9438
+
Field Name
9439
+
</th>
9440
+
<th>
9441
+
Value
9442
+
</th>
9443
+
<th>
9444
+
Meaning
9445
+
</th>
9446
+
</tr>
9447
+
<tr>
9448
+
<td>
9449
+
[[TargetModuleRec]]
9450
+
</td>
9451
+
<td>
9452
+
a Module Record
9453
+
</td>
9454
+
<td>
9455
+
?
9456
+
</td>
9457
+
</tr>
9458
+
<tr>
9459
+
<td>
9460
+
[[TargetName]]
9461
+
</td>
9462
+
<td>
9463
+
a String
9464
+
</td>
9465
+
<td>
9466
+
the name of a binding that exists in [[TargetModuleRec]]'s module Environment Record.
9467
+
</td>
9468
+
</tr>
9469
+
</tbody>
9470
+
</table>
9471
+
</emu-table>
9346
9472
<p>The behaviour of the additional concrete specification methods for module Environment Records are defined by the following algorithms:</p>
1. Assert: When _M_.[[Environment]] is instantiated it will have a direct binding for _N2_.
9402
-
1. Let _binding_ be an immutable indirect binding for _N_ that references _M_ and _N2_ as its target binding and record that the binding is initialized.
@@ -41886,8 +42013,8 @@ <h1>Changes to BlockDeclarationInstantiation</h1>
41886
42013
</emu-alg>
41887
42014
<p>During BlockDeclarationInstantiation the following steps are performed in place of step <emu-xref href="#step-blockdeclarationinstantiation-initializebinding"></emu-xref>:</p>
0 commit comments