Skip to content

Commit

Permalink
spec: Fix erroneous variables in algorithms
Browse files Browse the repository at this point in the history
  • Loading branch information
js-choi committed Oct 18, 2021
1 parent 4982015 commit 23799a2
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -413,27 +413,22 @@ <h1>Runtime Semantics: Evaluation</h1>
</emu-alg>

<ins class="block">

<emu-grammar>CallExpression : BindThisExpression Arguments</emu-grammar>
<emu-note>
<p>See also the <emu-xref href=#sec-bind-this-operator>bind-this operator</emu-xref>.</p>
</emu-note>
<emu-alg>
1. Let _expr_ be the |CallMemberExpression| that is covered by |CoverCallExpressionAndAsyncArrowHead|.
1. Let _bindThisExpr_ be the |BindThisExpression| of _expr_.
1. Let _thisExpr_ be the |MemberExpression| of _bindThisExpr_.
1. Let _thisExpr_ be the |MemberExpression| of |BindThisExpression|.
1. Let _bindThisRHS_ be the |SimpleMemberExpression| of _memberExpr_.
1. Let _funcExpr_ be the |MemberExpression| that is covered by _bindThisRHS_.
1. Let _arguments_ be the |Arguments| of _expr_.
1. Let _thisRef_ be the result of evaluating _thisExpr_.
1. Let _thisValue_ be ? GetValue(_thisRef_).
1. Let _funcRef_ be the result of evaluating _funcExpr_.
1. Let _func_ be ? GetValue(_funcRef_).
1. Let _thisCall_ be this |CallExpression|.
1. Let _tailCall_ be IsInTailPosition(_thisCall_).
1. Return EvaluateCall(_func_, _thisValue_, _arguments_, _tailCall_).
1. Return EvaluateCall(_func_, _thisValue_, |Arguments|, _tailCall_).
</emu-alg>

</ins>

<emu-grammar>CallExpression : CallExpression Arguments</emu-grammar>
Expand Down Expand Up @@ -649,27 +644,25 @@ <h1>
1. Let _optionalBindThisChain_ be the <emu-grammar>OptionalChain : `?.` `::` SimpleMemberExpression</emu-grammar> that is covered by |OptionalChain|.
1. Let _bindThisRHS_ be the |SimpleMemberExpression| of _optionalBindThisChain_.
1. Let _funcExpr_ be the |MemberExpression| that is covered by _bindThisRHS_.
1. Let _arguments_ be the |Arguments| of _expr_.
1. Let _funcRef_ be the result of evaluating _funcExpr_.
1. Let _func_ be ? GetValue(_funcRef_).
1. Let _thisChain_ be this |OptionalChain|.
1. Let _tailCall_ be IsInTailPosition(_thisChain_).
1. Return EvaluateCall(_func_, _baseValue_, _arguments_, _tailCall_).
1. Return EvaluateCall(_func_, _baseValue_, |Arguments|, _tailCall_).
</emu-alg>

<p>If |OptionalChain| (in <emu-grammar>OptionalChain : OptionalChain Arguments</emu-grammar>) is, in turn, covering the production <emu-grammar>OptionalChain : OptionalChain `::` SimpleMemberExpression</emu-grammar>, then the preceding algorithm is indistinguishable from the following:</p>
<emu-alg>
1. Let _bindThisOptionalChain_ be the <emu-grammar>OptionalChain : OptionalChain `::` SimpleMemberExpression</emu-grammar> that is covered by |OptionalChain|.
1. Let _bindThisRHS_ be the |SimpleMemberExpression| of _bindThisOptionalChain_.
1. Let _funcExpr_ be the |MemberExpression| that is covered by _bindThisRHS_.
1. Let _arguments_ be the |Arguments| of _expr_.
1. Let _thisRef_ be the result of evaluating ? ChainEvaluation of _thisOptionalChain_ with arguments _baseValue_ and _baseReference_.
1. Let _thisValue_ be ? GetValue(_thisRef_).
1. Let _funcRef_ be the result of evaluating _funcExpr_.
1. Let _func_ be ? GetValue(_funcRef_).
1. Let _thisChain_ be this |OptionalChain|.
1. Let _tailCall_ be IsInTailPosition(_thisChain_).
1. Return EvaluateCall(_func_, _thisValue_, _arguments_, _tailCall_).
1. Return EvaluateCall(_func_, _thisValue_, |Arguments|, _tailCall_).
</emu-alg>
</emu-note>
<emu-grammar>OptionalChain : OptionalChain `[` Expression `]`</emu-grammar>
Expand Down

0 comments on commit 23799a2

Please sign in to comment.