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
{{ message }}
This repository was archived by the owner on Jan 26, 2022. It is now read-only.
<p>This section is a wholly new sub-clause of the <ahref=https://tc39.github.io/ecma262/#sec-lexical-environments>original Lexical Environments clause</a>.</p>
30
-
</emu-note>
31
-
32
-
<p>The <dfn>topic binding</dfn> of a Lexical Environment immutably binds the topic reference `?` to one value of any ECMAScript language type (called the <dfn>topic value</dfn> or simply the <dfn>topic</dfn>), within that Lexical Environment, at the time of the Lexical Environment's instantiation. The topic of a Lexical Environment conceptually serves as the value that the lexical context is "about".</p>
33
-
34
-
<p>A <dfn>topic-binding environment</dfn> is a Lexical Environment that establishes a topic binding. The <dfn>topic environment</dfn> of the running execution context is its Lexical Environment's nearest outer environment that is a topic-binding environment, as defined by the abstract operator GetTopicEnvironment.</p>
35
-
36
-
<emu-note>
37
-
<p>The <strong>only</strong> Lexical Environments that are topic-binding environments are declarative environments that are associated with <strong>|PipelineTopicBody|</strong> and which were created with the <strong>TopicEnvironmentInstantiation</strong> abstract operation.</p>
38
-
39
-
<p>In addition, |PipelineTopicBody| <strong>hides</strong> its own inner topic references from the static semantic rule Contains. Within the scope of <emu-grammar>PipelineTopicBody:ConditionalExpression</emu-grammar>, such topic references would <strong>not</strong> trigger early error rules during program compilation. Instead, they would be evaluated at runtime into the values of the <strong>newly instantiated</strong> topic-binding environments' topic bindings.</p>
40
-
41
-
<p>No other Lexical Environments do not establish any topic bindings; in particular, object and global environments are never topic-binding environments.</p>
42
-
43
-
<p>In addition, |ScriptBody| and |ModuleBody| are associated with early error rules that <strong>forbid</strong> their containing the topic reference `?`, <strong>except</strong> where the topic reference is within |PipelineTopicBody|. These early error rules are defined using the static semantic rule Contains, from which |PipelineTopicBody| hides the topic reference.</p>
<p>This section augments the <ahref=https://tc39.github.io/ecma262/#sec-environment-records>original Environment Records clause</a>.</p>
29
+
<p>This section augments the <ahref=https://tc39.github.io/ecma262/https://tc39.es/ecma262/#sec-the-environment-record-type-hierarchy>original Environment Records clause</a>.</p>
53
30
</emu-note>
54
31
55
32
<emu-tableid=table-15caption="Abstract Methods of Environment Records">
@@ -70,7 +47,7 @@ <h1>Environment Records</h1>
70
47
<ins>HasTopicBinding()</ins>
71
48
</td>
72
49
<td>
73
-
<ins>Determine the status of an Environment Record's topic binding. Return *true* if it establishes a topic binding and *false* if it does not.</ins>
50
+
<ins>Determine whether an Environment Record is a topic-binding environment. Return *true* if it establishes a topic binding and *false* if it does not.</ins>
If [[TopicBindingStatus]]'s value is *true*, the Environment Record binds the Environment Record establishes its environment's topicbinding (that is, it binds `?`) to values. If the value is *false*, the Environment Record has no topic binding. [[TopicBindingStatus]]'s default value is *false*. Its value may be changed from *false* to *true* but never vice versa.
93
+
If [[TopicBindingStatus]]'s value is *true*, the declarative Environment Record is a topic-binding environment. If the value is *false*, the Environment Record has no topic binding. [[TopicBindingStatus]]'s default value is *false*. Its value may be changed from *false* to *true* but never vice versa.
<p>[[TopicValues]] is a List in order to be forward compatible with future extensions that would use multiple topic values, e.g., topic functions.</p>
112
+
<p>[[TopicValues]] is a List in order to be forward compatible with future extensions that would use multiple <emu-xrefhref="#sec-topic-bindings">topic values</emu-xref>, e.g., <ahref=https://github.com/js-choi/proposal-hack-pipes/blob/master/README.md#pipe-functions>"pipe functions".</a></p>
136
113
</emu-note>
137
114
138
115
<p>Declarative Environment Records support all of the abstract methods of Environment Records listed in <emu-xrefhref="#table-15"></emu-xref>. In addition, declarative Environment Records support the methods listed in <emu-xrefhref="#table-62"></emu-xref>.</p>
Establish the immutable topic binding of this Environment Record and set the topic binding's value. _V_ is a List containing the one element which is the topic value and is a value of any ECMAScript language type. Afterward, the value returned by the Environment Record's HasTopicBinding method is *true*. This method cannot be called more than once on any single Environment Record.
135
+
Establish the immutable topic binding of this Environment Record and set the topic binding's value. _V_ is a List containing the one element which is the topic value and is a value of any ECMAScript language type. Afterward, the Environment Record is a topic-binding environment, and the value returned by the Environment Record's HasTopicBinding method is *true*. This method cannot be called more than once on any single Environment Record.
<p>BindTopicValues() accepts a List argument rather than a single-value argument in order to be forward compatible with future extensions that would use multiple topic values, e.g., topic functions.</p>
144
+
<p>BindTopicValues() accepts a List argument rather than a single-value argument in order to be forward compatible with future extensions that would use multiple <emu-xrefhref="#sec-topic-bindings">topic values</emu-xref>, e.g., <ahref=https://github.com/js-choi/proposal-hack-pipes/blob/master/README.md#pipe-functions>"pipe functions".</a>.</p>
168
145
</emu-note>
169
146
170
147
<p>The behaviour of the concrete <ins>and additional</ins> specification methods for declarative Environment Records is defined by the following algorithms.</p>
<p>This section is a wholly new sub-clause of the <ahref=https://tc39.github.io/ecma262/#sec-environment-records>original Environment Records clause</a>.</p>
222
+
</emu-note>
223
+
224
+
<p>The <dfn>topic binding</dfn> of a declarative Environment Record immutably binds the topic reference `?` to one value of any ECMAScript language type (called the <dfn>topic value</dfn> or simply the <dfn>topic</dfn>), within that declarative Environment Record, at the time of the Environment Record's instantiation. The topic of a declarative Environment Record conceptually serves as the value that its lexical context is "about".</p>
225
+
226
+
<p>A <dfn>topic-binding environment</dfn> is a declarative Environment Record that establishes a topic binding. The <dfn>topic environment</dfn> of the running execution context is its LexicalEnvironment's nearest outer Environment Record that is also a topic-binding environment (or *null* if no such Environment Record exists), as defined by the abstract operator GetTopicEnvironment.</p>
227
+
228
+
<emu-note>
229
+
<p>The <strong>only</strong> Environment Records that are topic-binding environments are declarative environments that are associated with <strong>|PipelineTopicBody|</strong> and which were created with the <strong>TopicEnvironmentInstantiation</strong> abstract operation.</p>
230
+
231
+
<p>In addition, |PipelineTopicBody| <strong>hides</strong> its own inner topic references from the static semantic rule Contains. Within the scope of <emu-grammar>PipelineTopicBody:ConditionalExpression</emu-grammar>, such topic references would <strong>not</strong> trigger early error rules during program compilation. Instead, they would be evaluated at runtime into the values of the <strong>newly instantiated</strong> topic-binding environments' topic bindings.</p>
232
+
233
+
<p>In addition, |ScriptBody| and |ModuleBody| are associated with early error rules that <strong>forbid</strong> their containing the topic reference `?`, <strong>except</strong> where the topic reference is within |PipelineTopicBody|. These early error rules are defined using the static semantic rule Contains, from which |PipelineTopicBody| hides the topic reference.</p>
<p>The <dfn>topic reference</dfn>, which is the token `?`, is a nullary operator that evaluates to the value of the current Lexical Environment's topic. The topic reference acts as if it were a special variable: implicitly bound to the topic value, yet still lexically scoped. But `?` is not actually an |IdentifierName| and the topic reference is not a variable, and it cannot be bound by typical assignment; instead, it is immutably bound to a value during the instantiation of certain topic-binding environments.</p>
310
+
<p>The <dfn>topic reference</dfn>, which is the token `?`, is a nullary operator that evaluates to the current Environment Record's topic value. The topic reference acts as if it were a special variable: implicitly bound to the topic value, yet still lexically scoped. But `?` is not actually an |IdentifierName| and the topic reference is not a variable, and it cannot be bound by typical assignment; instead, it is immutably bound to a value during the instantiation of certain topic-binding environments.</p>
310
311
311
-
<p>The concept of lexical topic binding is further discussed in <emu-xrefhref="#sec-lexical-topics">Lexical Topics</emu-xref> and in <emu-xrefhref="#sec-declarative-environment-records">Declarative Environment Records</emu-xref>.</p>
312
+
<p>The concept of topic bindings is further discussed in <emu-xrefhref="#sec-topic-bindings">Topic Bindings</emu-xref> and in <emu-xrefhref="#sec-declarative-environment-records">Declarative Environment Records</emu-xref>.</p>
<p>This abstract operation constructs, instantiates, then returns a new declarative Lexical Environment for a pipeline body. It creates an immutable topic binding in that declarative environment using the given _topicValues_.</p>
436
+
<p>This abstract operation constructs, instantiates, then returns a new declarative Environment Record for a |PipelineTopicBody|. It creates an immutable topic binding in that declarative environment using the given _topicValues_.</p>
436
437
</emu-note>
437
438
<p>TopicPipelineInstantiation is performed as follows using arguments _env_ and _topicValues_.</p>
438
439
<ul>
439
-
<li>_env_ is the Lexical Environment in which the topic binding is to be created.</li>
440
+
<li>_env_ is the declarative Environment Record in which the topic binding is to be created.</li>
440
441
<li>_topicValues_ is a List of values: _env_'s primary topic reference will be bound to the first value.</li>
0 commit comments