Skip to content

Commit

Permalink
Editorial: factor out CaseClauseIsSelected()
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdyck committed Aug 12, 2017
1 parent d4f16c4 commit d77cccf
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -17375,9 +17375,7 @@ <h1>Runtime Semantics: CaseBlockEvaluation</h1>
1. Let _found_ be *false*.
1. For each |CaseClause| _C_ in _A_, do
1. If _found_ is *false*, then
1. Let _clauseSelector_ be the result of CaseSelectorEvaluation of _C_.
1. ReturnIfAbrupt(_clauseSelector_).
1. Set _found_ to the result of performing Strict Equality Comparison _input_ === _clauseSelector_.
1. Set _found_ to ? CaseClauseIsSelected(_C_, _input_).
1. If _found_ is *true*, then
1. Let _R_ be the result of evaluating _C_.
1. If _R_.[[Value]] is not ~empty~, set _V_ to _R_.[[Value]].
Expand All @@ -17394,9 +17392,7 @@ <h1>Runtime Semantics: CaseBlockEvaluation</h1>
1. Let _found_ be *false*.
1. For each |CaseClause| _C_ in _A_, do
1. If _found_ is *false*, then
1. Let _clauseSelector_ be the result of CaseSelectorEvaluation of _C_.
1. ReturnIfAbrupt(_clauseSelector_).
1. Set _found_ to the result of performing Strict Equality Comparison _input_ === _clauseSelector_.
1. Set _found_ to ? CaseClauseIsSelected(_C_, _input_).
1. If _found_ is *true*, then
1. Let _R_ be the result of evaluating _C_.
1. If _R_.[[Value]] is not ~empty~, set _V_ to _R_.[[Value]].
Expand All @@ -17409,9 +17405,7 @@ <h1>Runtime Semantics: CaseBlockEvaluation</h1>
1. If _found_ is *false*, then
1. For each |CaseClause| _C_ in _B_, do
1. If _foundInB_ is *false*, then
1. Let _clauseSelector_ be the result of CaseSelectorEvaluation of _C_.
1. ReturnIfAbrupt(_clauseSelector_).
1. Set _foundInB_ to the result of performing Strict Equality Comparison _input_ === _clauseSelector_.
1. Set _foundInB_ to ? CaseClauseIsSelected(_C_, _input_).
1. If _foundInB_ is *true*, then
1. Let _R_ be the result of evaluating |CaseClause| _C_.
1. If _R_.[[Value]] is not ~empty~, set _V_ to _R_.[[Value]].
Expand All @@ -17428,6 +17422,16 @@ <h1>Runtime Semantics: CaseBlockEvaluation</h1>
</emu-alg>
</emu-clause>

<emu-clause id="sec-runtime-semantics-caseclauseisselected" aoid="CaseClauseIsSelected">
<h1>Runtime Semantics: CaseClauseIsSelected ( _C_, _input_ )</h1>
<p>The abstract operation CaseClauseIsSelected, given |CaseClause| _C_ and value _input_, determines whether _C_ matches _input_.</p>
<emu-alg>
1. Let _clauseSelector_ be the result of CaseSelectorEvaluation of _C_.
1. ReturnIfAbrupt(_clauseSelector_).
1. Return the result of performing Strict Equality Comparison _input_ === _clauseSelector_.
</emu-alg>
</emu-clause>

<!-- es6num="13.12.10" -->
<emu-clause id="sec-runtime-semantics-caseselectorevaluation">
<h1>Runtime Semantics: CaseSelectorEvaluation</h1>
Expand Down

0 comments on commit d77cccf

Please sign in to comment.