Skip to content

Commit

Permalink
Editorial: add some more cross linking (#583)
Browse files Browse the repository at this point in the history
* Editorial: link "Assert" to the explanation of spec assertions

* Editorial: add cross links for reference concepts and operations

This also consistifies how they are referred to at their usage sites.
  • Loading branch information
domenic authored and bterlson committed Jun 7, 2016
1 parent 776a10e commit 5f7b2a3
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ <h1>Algorithm Conventions</h1>
</emu-alg>
<p>A step or substep may be written as an &ldquo;if&rdquo; predicate that conditions its substeps. In this case, the substeps are only applied if the predicate is true. If a step or substep begins with the word &ldquo;else&rdquo;, it is a predicate that is the negation of the preceding &ldquo;if&rdquo; predicate step at the same level.</p>
<p>A step may specify the iterative application of its substeps.</p>
<p>A step that begins with &ldquo;Assert:&rdquo; asserts an invariant condition of its algorithm. Such assertions are used to make explicit algorithmic invariants that would otherwise be implicit. Such assertions add no additional semantic requirements and hence need not be checked by an implementation. They are used simply to clarify algorithms.</p>
<p>A step that begins with &ldquo;<dfn id="assert">Assert</dfn>:&rdquo; asserts an invariant condition of its algorithm. Such assertions are used to make explicit algorithmic invariants that would otherwise be implicit. Such assertions add no additional semantic requirements and hence need not be checked by an implementation. They are used simply to clarify algorithms.</p>
<p>Mathematical operations such as addition, subtraction, negation, multiplication, division, and the mathematical functions defined later in this clause should always be understood as computing exact mathematical results on mathematical real numbers, which unless otherwise noted do not include infinities and do not include a negative zero that is distinguished from positive zero. Algorithms in this standard that model floating-point arithmetic include explicit steps, where necessary, to handle infinities and signed zero and to perform rounding. If a mathematical operation or function is applied to a floating-point number, it should be understood as being applied to the exact mathematical value represented by that floating-point number; such a floating-point number must be finite, and if it is *+0* or *-0* then the corresponding mathematical value is simply 0.</p>
<p>The mathematical function <emu-eqn aoid="abs">abs(_x_)</emu-eqn> produces the absolute value of _x_, which is <emu-eqn>-_x_</emu-eqn> if _x_ is negative (less than zero) and otherwise is _x_ itself.</p>
<p>The mathematical function <emu-eqn aoid="min">min(_x1_, _x2_, ..., _xN_)</emu-eqn> produces the mathematically smallest of <emu-eqn>_x1_</emu-eqn> through <emu-eqn>_xN_</emu-eqn>. The mathematical function <emu-eqn aoid="max">max(_x1_, _x2_, ..., _xN_)</emu-eqn> produces the mathematically largest of <emu-eqn>_x1_</emu-eqn> through <emu-eqn>_xN_</emu-eqn>. The domain and range of these mathematical functions include *+&infin;* and *-&infin;*.</p>
Expand Down Expand Up @@ -2701,30 +2701,30 @@ <h1>The Reference Specification Type</h1>
<emu-note>
<p>The Reference type is used to explain the behaviour of such operators as `delete`, `typeof`, the assignment operators, the `super` keyword and other language features. For example, the left-hand operand of an assignment is expected to produce a reference.</p>
</emu-note>
<p>A <dfn>Reference</dfn> is a resolved name or property binding. A Reference consists of three components, the <em>base</em> value, the <em>referenced name</em> and the Boolean valued <em>strict reference</em> flag. The <em>base</em> value is either *undefined*, an Object, a Boolean, a String, a Symbol, a Number, or an Environment Record. A _base_ value of *undefined* indicates that the Reference could not be resolved to a binding. The <em>referenced name</em> is a String or Symbol value.</p>
<p>A Super Reference is a Reference that is used to represents a name binding that was expressed using the super keyword. A Super Reference has an additional _thisValue_ component and its _base_ value will never be an Environment Record.</p>
<p>A <dfn>Reference</dfn> is a resolved name or property binding. A Reference consists of three components, the base value component, the referenced name component, and the Boolean-valued strict reference flag. The base value component is either *undefined*, an Object, a Boolean, a String, a Symbol, a Number, or an Environment Record. A base value component of *undefined* indicates that the Reference could not be resolved to a binding. The referenced name component is a String or Symbol value.</p>
<p>A <dfn id="super-reference">Super Reference</dfn> is a Reference that is used to represents a name binding that was expressed using the super keyword. A Super Reference has an additional thisValue component, and its base value component will never be an Environment Record.</p>
<p>The following abstract operations are used in this specification to access the components of references:</p>
<ul>
<li>
GetBase(V). Returns the _base_ value component of the reference V.
<dfn aoid="GetBase" id="ao-getbase">GetBase</dfn>(_V_). Returns the base value component of the reference _V_.
</li>
<li>
GetReferencedName(V). Returns the <i>referenced name</i> component of the reference V.
<dfn aoid="GetReferencedName" id="ao-getreferencedname">GetReferencedName</dfn>(_V_). Returns the referenced name component of the reference _V_.
</li>
<li>
IsStrictReference(V). Returns the <i>strict reference</i> flag component of the reference V.
<dfn aoid="IsStrictReference" id="ao-isstrictreference">IsStrictReference</dfn>(_V_). Returns the strict reference flag of the reference _V_.
</li>
<li>
HasPrimitiveBase(V). Returns *true* if Type(_base_) is Boolean, String, Symbol, or Number.
<dfn aoid="HasPrimitiveBase" id="ao-hasprimitivebase">HasPrimitiveBase</dfn>(_V_). Returns *true* if Type(_V_'s base value component) is Boolean, String, Symbol, or Number.
</li>
<li>
IsPropertyReference(V). Returns *true* if either the _base_ value is an object or HasPrimitiveBase(V) is *true*; otherwise returns *false*.
<dfn aoid="IsPropertyReference" id="ao-ispropertyreference">IsPropertyReference</dfn>(_V_). Returns *true* if either the base value component of the reference _V_ is an object or HasPrimitiveBase(_V_) is *true*; otherwise returns *false*.
</li>
<li>
IsUnresolvableReference(V). Returns *true* if the _base_ value is *undefined* and *false* otherwise.
<dfn aoid="IsUnresolvableReference" id="ao-isunresolvablereference">IsUnresolvableReference</dfn>(_V_). Returns *true* if the base value component of the reference _V_ is *undefined*; otherwise returns *false*.
</li>
<li>
IsSuperReference(V). Returns *true* if this reference has a _thisValue_ component.
<dfn aoid="IsSuperReference" id="ao-issuperreference">IsSuperReference</dfn>(_V_). Returns *true* if the reference _V_ has a thisValue component.
</li>
</ul>
<p>The following abstract operations are used in this specification to operate on references:</p>
Expand Down Expand Up @@ -2784,7 +2784,7 @@ <h1>GetThisValue (_V_)</h1>
<emu-alg>
1. Assert: IsPropertyReference(_V_) is *true*.
1. If IsSuperReference(_V_) is *true*, then
1. Return the value of the _thisValue_ component of the reference _V_.
1. Return the value of the thisValue component of the reference _V_.
1. Return GetBase(_V_).
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -5647,11 +5647,11 @@ <h1>GetIdentifierReference (_lex_, _name_, _strict_)</h1>
<p>The abstract operation GetIdentifierReference is called with a Lexical Environment _lex_, a String _name_, and a Boolean flag _strict_. The value of _lex_ may be *null*. When called, the following steps are performed:</p>
<emu-alg>
1. If _lex_ is the value *null*, then
1. Return a value of type Reference whose base value is *undefined*, whose referenced name is _name_, and whose strict reference flag is _strict_.
1. Return a value of type Reference whose base value component is *undefined*, whose referenced name component is _name_, and whose strict reference flag is _strict_.
1. Let _envRec_ be _lex_'s EnvironmentRecord.
1. Let _exists_ be ? _envRec_.HasBinding(_name_).
1. If _exists_ is *true*, then
1. Return a value of type Reference whose base value is _envRec_, whose referenced name is _name_, and whose strict reference flag is _strict_.
1. Return a value of type Reference whose base value component is _envRec_, whose referenced name component is _name_, and whose strict reference flag is _strict_.
1. Else,
1. Let _outer_ be the value of _lex_'s outer environment reference.
1. Return ? GetIdentifierReference(_outer_, _name_, _strict_).
Expand Down Expand Up @@ -11813,7 +11813,7 @@ <h1>Runtime Semantics: Evaluation</h1>
1. Let _bv_ be ? RequireObjectCoercible(_baseValue_).
1. Let _propertyKey_ be ? ToPropertyKey(_propertyNameValue_).
1. If the code matched by the syntactic production that is being evaluated is strict mode code, let _strict_ be *true*, else let _strict_ be *false*.
1. Return a value of type Reference whose base value is _bv_, whose referenced name is _propertyKey_, and whose strict reference flag is _strict_.
1. Return a value of type Reference whose base value component is _bv_, whose referenced name component is _propertyKey_, and whose strict reference flag is _strict_.
</emu-alg>
<emu-grammar>MemberExpression : MemberExpression `.` IdentifierName</emu-grammar>
<emu-alg>
Expand All @@ -11822,7 +11822,7 @@ <h1>Runtime Semantics: Evaluation</h1>
1. Let _bv_ be ? RequireObjectCoercible(_baseValue_).
1. Let _propertyNameString_ be StringValue of |IdentifierName|.
1. If the code matched by the syntactic production that is being evaluated is strict mode code, let _strict_ be *true*, else let _strict_ be *false*.
1. Return a value of type Reference whose base value is _bv_, whose referenced name is _propertyNameString_, and whose strict reference flag is _strict_.
1. Return a value of type Reference whose base value component is _bv_, whose referenced name component is _propertyNameString_, and whose strict reference flag is _strict_.
</emu-alg>
<emu-grammar>CallExpression : CallExpression `[` Expression `]`</emu-grammar>
<p>Is evaluated in exactly the same manner as <emu-grammar>MemberExpression : MemberExpression `[` Expression `]`</emu-grammar> except that the contained |CallExpression| is evaluated in step 1.</p>
Expand Down Expand Up @@ -12002,7 +12002,7 @@ <h1>Runtime Semantics: MakeSuperPropertyReference(_propertyKey_, _strict_)</h1>
1. Let _actualThis_ be ? _env_.GetThisBinding().
1. Let _baseValue_ be ? _env_.GetSuperBase().
1. Let _bv_ be ? RequireObjectCoercible(_baseValue_).
1. Return a value of type Reference that is a Super Reference whose base value is _bv_, whose referenced name is _propertyKey_, whose thisValue is _actualThis_, and whose strict reference flag is _strict_.
1. Return a value of type Reference that is a Super Reference whose base value component is _bv_, whose referenced name component is _propertyKey_, whose thisValue component is _actualThis_, and whose strict reference flag is _strict_.
</emu-alg>
</emu-clause>
</emu-clause>
Expand Down

0 comments on commit 5f7b2a3

Please sign in to comment.