| cptn-a-abrupt-empty.js |
---
es6id: 13.12.11
description: >
Completion value when the matching case is exited via an empty abrupt
completion
info: |
SwitchStatement : switch ( Expression ) CaseBlock
[...]
8. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
9. Set the running execution context’s LexicalEnvironment to oldEnv.
10. Return R.
13.12.9 Runtime Semantics: CaseBlockEvaluation
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
1. Let V = undefined.
2. Let A be the list of CaseClause items in the first CaseClauses, in
source text order. If the first CaseClauses is not present A is « ».
3. Let found be false.
4. Repeat for each CaseClause C in A
a. If found is false, then
i. Let clauseSelector be the result of CaseSelectorEvaluation of C.
ii. If clauseSelector is an abrupt completion, then
1. If clauseSelector.[[value]] is empty, return
Completion{[[type]]: clauseSelector.[[type]], [[value]]:
undefined, [[target]]: clauseSelector.[[target]]}.
2. Else, return Completion(clauseSelector).
iii. Let found be the result of performing Strict Equality Comparison
input === clauseSelector.[[value]].
b. If found is true, then
i. Let R be the result of evaluating C.
ii. If R.[[value]] is not empty, let V = R.[[value]].
iii. If R is an abrupt completion, return Completion(UpdateEmpty(R,
V)).
--- |
2124 |
- |
| cptn-a-fall-thru-abrupt-empty.js |
---
es6id: 13.12.11
description: >
Completion value when execution continues through multiple cases and ends
with an empty abrupt completion
info: |
SwitchStatement : switch ( Expression ) CaseBlock
[...]
8. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
9. Set the running execution context’s LexicalEnvironment to oldEnv.
10. Return R.
13.12.9 Runtime Semantics: CaseBlockEvaluation
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
1. Let V = undefined.
2. Let A be the list of CaseClause items in the first CaseClauses, in
source text order. If the first CaseClauses is not present A is « ».
3. Let found be false.
4. Repeat for each CaseClause C in A
a. If found is false, then
[...]
b. If found is true, then
i. Let R be the result of evaluating C.
ii. If R.[[value]] is not empty, let V = R.[[value]].
iii. If R is an abrupt completion, return Completion(UpdateEmpty(R,
V)).
--- |
2198 |
- |
| cptn-a-fall-thru-nrml.js |
---
es6id: 13.12.11
description: >
Completion value when execution continues through multiple cases and ends
with a normal completion
info: |
SwitchStatement : switch ( Expression ) CaseBlock
[...]
8. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
9. Set the running execution context’s LexicalEnvironment to oldEnv.
10. Return R.
13.12.9 Runtime Semantics: CaseBlockEvaluation
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
1. Let V = undefined.
2. Let A be the list of CaseClause items in the first CaseClauses, in
source text order. If the first CaseClauses is not present A is « ».
3. Let found be false.
4. Repeat for each CaseClause C in A
a. If found is false, then
i. Let clauseSelector be the result of CaseSelectorEvaluation of C.
ii. If clauseSelector is an abrupt completion, then
[...]
iii. Let found be the result of performing Strict Equality Comparison
input === clauseSelector.[[value]].
b. If found is true, then
i. Let R be the result of evaluating C.
ii. If R.[[value]] is not empty, let V = R.[[value]].
[...]
5. Let foundInB be false.
6. Let B be the List containing the CaseClause items in the second
CaseClauses, in source text order. If the second CaseClauses is not
present B is « ».
7. If found is false, then
[...]
[...]
9. Let R be the result of evaluating DefaultClause.
10. If R.[[value]] is not empty, let V = R.[[value]].
11. If R is an abrupt completion, return Completion(UpdateEmpty(R, V)).
12. Repeat for each CaseClause C in B (NOTE this is another complete
iteration of the second CaseClauses)
[...]
13. Return NormalCompletion(V).
--- |
2423 |
- |
| cptn-abrupt-empty.js |
---
es6id: 13.12.11
description: >
Completion value when case block is empty
info: |
SwitchStatement : switch ( Expression ) CaseBlock
[...]
8. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
9. Set the running execution context’s LexicalEnvironment to oldEnv.
10. Return R.
13.12.9 Runtime Semantics: CaseBlockEvaluation
CaseBlock : { }
1. Return NormalCompletion(undefined).
--- |
677 |
- |
| cptn-b-abrupt-empty.js |
---
es6id: 13.12.11
description: >
Completion value when the matching case is exited via an empty abrupt
completion
info: |
SwitchStatement : switch ( Expression ) CaseBlock
[...]
8. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
9. Set the running execution context’s LexicalEnvironment to oldEnv.
10. Return R.
13.12.9 Runtime Semantics: CaseBlockEvaluation
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
1. Let V = undefined.
2. Let A be the list of CaseClause items in the first CaseClauses, in
source text order. If the first CaseClauses is not present A is « ».
3. Let found be false.
4. Repeat for each CaseClause C in A
[...]
5. Let foundInB be false.
6. Let B be the List containing the CaseClause items in the second
CaseClauses, in source text order. If the second CaseClauses is not
present B is « ».
7. If found is false, then
a. Repeat for each CaseClause C in B
i. If foundInB is false, then
1. Let clauseSelector be the result of CaseSelectorEvaluation of
C.
2. If clauseSelector is an abrupt completion, then
a. If clauseSelector.[[value]] is empty, return
Completion{[[type]]: clauseSelector.[[type]], [[value]]:
undefined, [[target]]: clauseSelector.[[target]]}.
b. Else, return Completion(clauseSelector).
3. Let foundInB be the result of performing Strict Equality
Comparison input === clauseSelector.[[value]].
ii. If foundInB is true, then
1. Let R be the result of evaluating CaseClause C.
2. If R.[[value]] is not empty, let V = R.[[value]].
3. If R is an abrupt completion, return
Completion(UpdateEmpty(R, V)).
--- |
2489 |
- |
| cptn-b-fall-thru-abrupt-empty.js |
---
es6id: 13.12.11
description: >
Completion value when execution continues through multiple cases and ends
with an empty abrupt completion
info: |
SwitchStatement : switch ( Expression ) CaseBlock
[...]
8. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
9. Set the running execution context’s LexicalEnvironment to oldEnv.
10. Return R.
13.12.9 Runtime Semantics: CaseBlockEvaluation
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
1. Let V = undefined.
2. Let A be the list of CaseClause items in the first CaseClauses, in
source text order. If the first CaseClauses is not present A is « ».
3. Let found be false.
4. Repeat for each CaseClause C in A
[...]
5. Let foundInB be false.
6. Let B be the List containing the CaseClause items in the second
CaseClauses, in source text order. If the second CaseClauses is not
present B is « ».
7. If found is false, then
a. Repeat for each CaseClause C in B
i. If foundInB is false, then
1. Let clauseSelector be the result of CaseSelectorEvaluation of
C.
2. If clauseSelector is an abrupt completion, then
a. If clauseSelector.[[value]] is empty, return
Completion{[[type]]: clauseSelector.[[type]], [[value]]:
undefined, [[target]]: clauseSelector.[[target]]}.
b. Else, return Completion(clauseSelector).
3. Let foundInB be the result of performing Strict Equality
Comparison input === clauseSelector.[[value]].
ii. If foundInB is true, then
1. Let R be the result of evaluating CaseClause C.
2. If R.[[value]] is not empty, let V = R.[[value]].
3. If R is an abrupt completion, return
Completion(UpdateEmpty(R, V)).
--- |
3080 |
- |
| cptn-b-fall-thru-nrml.js |
---
es6id: 13.12.11
description: >
Completion value when execution continues through multiple cases and ends
with a normal completion
info: |
SwitchStatement : switch ( Expression ) CaseBlock
[...]
8. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
9. Set the running execution context’s LexicalEnvironment to oldEnv.
10. Return R.
13.12.9 Runtime Semantics: CaseBlockEvaluation
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
1. Let V = undefined.
2. Let A be the list of CaseClause items in the first CaseClauses, in
source text order. If the first CaseClauses is not present A is « ».
3. Let found be false.
4. Repeat for each CaseClause C in A
[...]
5. Let foundInB be false.
6. Let B be the List containing the CaseClause items in the second
CaseClauses, in source text order. If the second CaseClauses is not
present B is « ».
7. If found is false, then
a. Repeat for each CaseClause C in B
i. If foundInB is false, then
1. Let clauseSelector be the result of CaseSelectorEvaluation of
C.
2. If clauseSelector is an abrupt completion, then
a. If clauseSelector.[[value]] is empty, return
Completion{[[type]]: clauseSelector.[[type]], [[value]]:
undefined, [[target]]: clauseSelector.[[target]]}.
b. Else, return Completion(clauseSelector).
3. Let foundInB be the result of performing Strict Equality
Comparison input === clauseSelector.[[value]].
ii. If foundInB is true, then
1. Let R be the result of evaluating CaseClause C.
2. If R.[[value]] is not empty, let V = R.[[value]].
3. If R is an abrupt completion, return
Completion(UpdateEmpty(R, V)).
8. If foundInB is true, return NormalCompletion(V).
--- |
2583 |
- |
| cptn-b-final.js |
---
es6id: 13.12.11
description: Completion value when the final case matches
info: |
SwitchStatement : switch ( Expression ) CaseBlock
[...]
8. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
9. Set the running execution context’s LexicalEnvironment to oldEnv.
10. Return R.
13.12.9 Runtime Semantics: CaseBlockEvaluation
CaseBlock : { CaseClauses }
1. Let V = undefined.
2. Let A be the list of CaseClause items in the first CaseClauses, in
source text order. If the first CaseClauses is not present A is « ».
3. Let found be false.
4. Repeat for each CaseClause C in A
[...]
5. Let foundInB be false.
6. Let B be the List containing the CaseClause items in the second
CaseClauses, in source text order. If the second CaseClauses is not
present B is « ».
7. If found is false, then
a. Repeat for each CaseClause C in B
i. If foundInB is false, then
1. Let clauseSelector be the result of CaseSelectorEvaluation of
C.
2. If clauseSelector is an abrupt completion, then
a. If clauseSelector.[[value]] is empty, return
Completion{[[type]]: clauseSelector.[[type]], [[value]]:
undefined, [[target]]: clauseSelector.[[target]]}.
b. Else, return Completion(clauseSelector).
3. Let foundInB be the result of performing Strict Equality
Comparison input === clauseSelector.[[value]].
ii. If foundInB is true, then
1. Let R be the result of evaluating CaseClause C.
2. If R.[[value]] is not empty, let V = R.[[value]].
3. If R is an abrupt completion, return
Completion(UpdateEmpty(R, V)).
8. If foundInB is true, return NormalCompletion(V).
--- |
2891 |
- |
| cptn-dflt-abrupt-empty.js |
---
es6id: 13.12.11
description: >
Completion value when the default case is exited via an empty abrupt
completion
info: |
SwitchStatement : switch ( Expression ) CaseBlock
[...]
8. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
9. Set the running execution context’s LexicalEnvironment to oldEnv.
10. Return R.
13.12.9 Runtime Semantics: CaseBlockEvaluation
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
1. Let V = undefined.
2. Let A be the list of CaseClause items in the first CaseClauses, in
source text order. If the first CaseClauses is not present A is « ».
3. Let found be false.
4. Repeat for each CaseClause C in A
[...]
5. Let foundInB be false.
6. Let B be the List containing the CaseClause items in the second
CaseClauses, in source text order. If the second CaseClauses is not
present B is « ».
7. If found is false, then
[...]
8. If foundInB is true, return NormalCompletion(V).
9. Let R be the result of evaluating DefaultClause.
10. If R.[[value]] is not empty, let V = R.[[value]].
11. If R is an abrupt completion, return Completion(UpdateEmpty(R, V)).
--- |
1773 |
- |
| cptn-dflt-b-abrupt-empty.js |
---
es6id: 13.12.11
description: >
Completion value when the matching case is exited via an empty abrupt
completion
info: |
SwitchStatement : switch ( Expression ) CaseBlock
[...]
8. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
9. Set the running execution context’s LexicalEnvironment to oldEnv.
10. Return R.
13.12.9 Runtime Semantics: CaseBlockEvaluation
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
1. Let V = undefined.
2. Let A be the list of CaseClause items in the first CaseClauses, in
source text order. If the first CaseClauses is not present A is « ».
3. Let found be false.
4. Repeat for each CaseClause C in A
[...]
5. Let foundInB be false.
6. Let B be the List containing the CaseClause items in the second
CaseClauses, in source text order. If the second CaseClauses is not
present B is « ».
7. If found is false, then
a. Repeat for each CaseClause C in B
i. If foundInB is false, then
1. Let clauseSelector be the result of CaseSelectorEvaluation of
C.
[...]
3. Let foundInB be the result of performing Strict Equality
Comparison input === clauseSelector.[[value]].
ii. If foundInB is true, then
[...]
8. If foundInB is true, return NormalCompletion(V).
9. Let R be the result of evaluating DefaultClause.
10. If R.[[value]] is not empty, let V = R.[[value]].
11. If R is an abrupt completion, return Completion(UpdateEmpty(R, V)).
12. Repeat for each CaseClause C in B (NOTE this is another complete
iteration of the second CaseClauses)
a. Let R be the result of evaluating CaseClause C.
b. If R.[[value]] is not empty, let V = R.[[value]].
c. If R is an abrupt completion, return Completion(UpdateEmpty(R, V)).
--- |
2520 |
- |
| cptn-dflt-b-fall-thru-abrupt-empty.js |
---
es6id: 13.12.11
description: >
Completion value when execution continues through multiple cases and ends
with an empty abrupt completion
info: |
SwitchStatement : switch ( Expression ) CaseBlock
[...]
8. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
9. Set the running execution context’s LexicalEnvironment to oldEnv.
10. Return R.
13.12.9 Runtime Semantics: CaseBlockEvaluation
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
1. Let V = undefined.
2. Let A be the list of CaseClause items in the first CaseClauses, in
source text order. If the first CaseClauses is not present A is « ».
3. Let found be false.
4. Repeat for each CaseClause C in A
[...]
5. Let foundInB be false.
6. Let B be the List containing the CaseClause items in the second
CaseClauses, in source text order. If the second CaseClauses is not
present B is « ».
7. If found is false, then
a. Repeat for each CaseClause C in B
i. If foundInB is false, then
1. Let clauseSelector be the result of CaseSelectorEvaluation of
C.
[...]
3. Let foundInB be the result of performing Strict Equality
Comparison input === clauseSelector.[[value]].
ii. If foundInB is true, then
[...]
8. If foundInB is true, return NormalCompletion(V).
9. Let R be the result of evaluating DefaultClause.
10. If R.[[value]] is not empty, let V = R.[[value]].
11. If R is an abrupt completion, return Completion(UpdateEmpty(R, V)).
12. Repeat for each CaseClause C in B (NOTE this is another complete
iteration of the second CaseClauses)
a. Let R be the result of evaluating CaseClause C.
b. If R.[[value]] is not empty, let V = R.[[value]].
c. If R is an abrupt completion, return Completion(UpdateEmpty(R, V)).
--- |
3111 |
- |
| cptn-dflt-b-fall-thru-nrml.js |
---
es6id: 13.12.11
description: >
Completion value when execution continues through multiple cases and ends
with a normal completion
info: |
SwitchStatement : switch ( Expression ) CaseBlock
[...]
8. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
9. Set the running execution context’s LexicalEnvironment to oldEnv.
10. Return R.
13.12.9 Runtime Semantics: CaseBlockEvaluation
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
1. Let V = undefined.
2. Let A be the list of CaseClause items in the first CaseClauses, in
source text order. If the first CaseClauses is not present A is « ».
3. Let found be false.
4. Repeat for each CaseClause C in A
[...]
5. Let foundInB be false.
6. Let B be the List containing the CaseClause items in the second
CaseClauses, in source text order. If the second CaseClauses is not
present B is « ».
7. If found is false, then
a. Repeat for each CaseClause C in B
i. If foundInB is false, then
1. Let clauseSelector be the result of CaseSelectorEvaluation of
C.
[...]
3. Let foundInB be the result of performing Strict Equality
Comparison input === clauseSelector.[[value]].
ii. If foundInB is true, then
[...]
8. If foundInB is true, return NormalCompletion(V).
9. Let R be the result of evaluating DefaultClause.
10. If R.[[value]] is not empty, let V = R.[[value]].
11. If R is an abrupt completion, return Completion(UpdateEmpty(R, V)).
12. Repeat for each CaseClause C in B (NOTE this is another complete
iteration of the second CaseClauses)
a. Let R be the result of evaluating CaseClause C.
b. If R.[[value]] is not empty, let V = R.[[value]].
c. If R is an abrupt completion, return Completion(UpdateEmpty(R, V)).
13. Return NormalCompletion(V).
--- |
2594 |
- |
| cptn-dflt-b-final.js |
---
es6id: 13.12.11
description: Completion value when the final case matches
info: |
SwitchStatement : switch ( Expression ) CaseBlock
[...]
8. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
9. Set the running execution context’s LexicalEnvironment to oldEnv.
10. Return R.
13.12.9 Runtime Semantics: CaseBlockEvaluation
CaseBlock : { CaseClauses }
1. Let V = undefined.
2. Let A be the list of CaseClause items in the first CaseClauses, in
source text order. If the first CaseClauses is not present A is « ».
3. Let found be false.
4. Repeat for each CaseClause C in A
[...]
5. Let foundInB be false.
6. Let B be the List containing the CaseClause items in the second
CaseClauses, in source text order. If the second CaseClauses is not
present B is « ».
7. If found is false, then
a. Repeat for each CaseClause C in B
i. If foundInB is false, then
1. Let clauseSelector be the result of CaseSelectorEvaluation of
C.
[...]
3. Let foundInB be the result of performing Strict Equality
Comparison input === clauseSelector.[[value]].
ii. If foundInB is true, then
[...]
8. If foundInB is true, return NormalCompletion(V).
9. Let R be the result of evaluating DefaultClause.
10. If R.[[value]] is not empty, let V = R.[[value]].
11. If R is an abrupt completion, return Completion(UpdateEmpty(R, V)).
12. Repeat for each CaseClause C in B (NOTE this is another complete
iteration of the second CaseClauses)
a. Let R be the result of evaluating CaseClause C.
b. If R.[[value]] is not empty, let V = R.[[value]].
c. If R is an abrupt completion, return Completion(UpdateEmpty(R, V)).
13. Return NormalCompletion(V).
--- |
2894 |
- |
| cptn-dflt-fall-thru-abrupt-empty.js |
---
es6id: 13.12.11
description: >
Completion value when execution continues through multiple cases and ends
with an empty abrupt completion in the default case
info: |
SwitchStatement : switch ( Expression ) CaseBlock
[...]
8. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
9. Set the running execution context’s LexicalEnvironment to oldEnv.
10. Return R.
13.12.9 Runtime Semantics: CaseBlockEvaluation
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
1. Let V = undefined.
2. Let A be the list of CaseClause items in the first CaseClauses, in
source text order. If the first CaseClauses is not present A is « ».
3. Let found be false.
4. Repeat for each CaseClause C in A
[...]
5. Let foundInB be false.
6. Let B be the List containing the CaseClause items in the second
CaseClauses, in source text order. If the second CaseClauses is not
present B is « ».
7. If found is false, then
[...]
8. If foundInB is true, return NormalCompletion(V).
9. Let R be the result of evaluating DefaultClause.
10. If R.[[value]] is not empty, let V = R.[[value]].
11. If R is an abrupt completion, return Completion(UpdateEmpty(R, V)).
--- |
2369 |
- |
| cptn-dflt-fall-thru-nrml.js |
---
es6id: 13.12.11
description: >
Completion value when execution continues through multiple cases and ends
with a normal completion in the default case
info: |
SwitchStatement : switch ( Expression ) CaseBlock
[...]
8. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
9. Set the running execution context’s LexicalEnvironment to oldEnv.
10. Return R.
13.12.9 Runtime Semantics: CaseBlockEvaluation
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
1. Let V = undefined.
2. Let A be the list of CaseClause items in the first CaseClauses, in
source text order. If the first CaseClauses is not present A is « ».
3. Let found be false.
4. Repeat for each CaseClause C in A
[...]
5. Let foundInB be false.
6. Let B be the List containing the CaseClause items in the second
CaseClauses, in source text order. If the second CaseClauses is not
present B is « ».
7. If found is false, then
[...]
8. If foundInB is true, return NormalCompletion(V).
9. Let R be the result of evaluating DefaultClause.
10. If R.[[value]] is not empty, let V = R.[[value]].
11. If R is an abrupt completion, return Completion(UpdateEmpty(R, V)).
12. Repeat for each CaseClause C in B (NOTE this is another complete
iteration of the second CaseClauses)
[...]
13. Return NormalCompletion(V).
--- |
2014 |
- |
| cptn-dflt-final.js |
---
es6id: 13.12.11
description: Completion value when the default case matches and is final
info: |
SwitchStatement : switch ( Expression ) CaseBlock
[...]
8. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
9. Set the running execution context’s LexicalEnvironment to oldEnv.
10. Return R.
13.12.9 Runtime Semantics: CaseBlockEvaluation
CaseBlock : { CaseClauses }
1. Let V = undefined.
2. Let A be the list of CaseClause items in the first CaseClauses, in
source text order. If the first CaseClauses is not present A is « ».
3. Let found be false.
4. Repeat for each CaseClause C in A
[...]
5. Let foundInB be false.
6. Let B be the List containing the CaseClause items in the second
CaseClauses, in source text order. If the second CaseClauses is not
present B is « ».
7. If found is false, then
a. Repeat for each CaseClause C in B
[...]
8. If foundInB is true, return NormalCompletion(V).
9. Let R be the result of evaluating DefaultClause.
10. If R.[[value]] is not empty, let V = R.[[value]].
[...]
13. Return NormalCompletion(V).
--- |
2133 |
- |
| cptn-no-dflt-match-abrupt-empty.js |
---
es6id: 13.12.11
description: >
Completion value when the matching case is exited via an empty abrupt
completion
info: |
SwitchStatement : switch ( Expression ) CaseBlock
[...]
8. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
9. Set the running execution context’s LexicalEnvironment to oldEnv.
10. Return R.
13.12.9 Runtime Semantics: CaseBlockEvaluation
CaseBlock : { CaseClauses }
1. Let V = undefined.
2. Let A be the List of CaseClause items in CaseClauses, in source text
order.
3. Let found be false.
4. Repeat for each CaseClause C in A,
a. If found is false, then
i. Let clauseSelector be the result of CaseSelectorEvaluation of C.
ii. If clauseSelector is an abrupt completion, then
1. If clauseSelector.[[value]] is empty, return
Completion{[[type]]: clauseSelector.[[type]], [[value]]:
undefined, [[target]]: clauseSelector.[[target]]}.
2. Else, return Completion(clauseSelector).
iii. Let found be the result of performing Strict Equality Comparison
input === clauseSelector.[[value]].
b. If found is true, then
i. Let R be the result of evaluating C.
ii. If R.[[value]] is not empty, let V = R.[[value]].
iii. If R is an abrupt completion, return Completion(UpdateEmpty(R,
V)).
--- |
1993 |
- |
| cptn-no-dflt-match-fall-thru-abrupt-empty.js |
---
es6id: 13.12.11
description: >
Completion value when execution continues through multiple cases and ends
with an empty abrupt completion
info: |
SwitchStatement : switch ( Expression ) CaseBlock
[...]
8. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
9. Set the running execution context’s LexicalEnvironment to oldEnv.
10. Return R.
13.12.9 Runtime Semantics: CaseBlockEvaluation
CaseBlock : { CaseClauses }
1. Let V = undefined.
2. Let A be the List of CaseClause items in CaseClauses, in source text
order.
3. Let found be false.
4. Repeat for each CaseClause C in A,
a. If found is false, then
[...]
b. If found is true, then
i. Let R be the result of evaluating C.
ii. If R.[[value]] is not empty, let V = R.[[value]].
iii. If R is an abrupt completion, return Completion(UpdateEmpty(R,
V)).
--- |
2051 |
- |
| cptn-no-dflt-match-fall-thru-nrml.js |
---
es6id: 13.12.11
description: >
Completion value when execution continues through multiple cases and ends
with a normal completion
info: |
SwitchStatement : switch ( Expression ) CaseBlock
[...]
8. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
9. Set the running execution context’s LexicalEnvironment to oldEnv.
10. Return R.
13.12.9 Runtime Semantics: CaseBlockEvaluation
CaseBlock : { CaseClauses }
1. Let V = undefined.
2. Let A be the List of CaseClause items in CaseClauses, in source text
order.
3. Let found be false.
4. Repeat for each CaseClause C in A,
a. If found is false, then
[...]
b. If found is true, then
i. Let R be the result of evaluating C.
ii. If R.[[value]] is not empty, let V = R.[[value]].
[...]
5. Return NormalCompletion(V).
--- |
1478 |
- |
| cptn-no-dflt-match-final.js |
---
es6id: 13.12.11
description: Completion value when only the final case matches
info: |
SwitchStatement : switch ( Expression ) CaseBlock
[...]
8. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
9. Set the running execution context’s LexicalEnvironment to oldEnv.
10. Return R.
13.12.9 Runtime Semantics: CaseBlockEvaluation
CaseBlock : { CaseClauses }
1. Let V = undefined.
2. Let A be the List of CaseClause items in CaseClauses, in source text
order.
3. Let found be false.
4. Repeat for each CaseClause C in A,
a. If found is false, then
i. Let clauseSelector be the result of CaseSelectorEvaluation of C.
ii. If clauseSelector is an abrupt completion, then
1. If clauseSelector.[[value]] is empty, return
Completion{[[type]]: clauseSelector.[[type]], [[value]]:
undefined, [[target]]: clauseSelector.[[target]]}.
2. Else, return Completion(clauseSelector).
iii. Let found be the result of performing Strict Equality Comparison
input === clauseSelector.[[value]].
b. If found is true, then
i. Let R be the result of evaluating C.
ii. If R.[[value]] is not empty, let V = R.[[value]].
iii. If R is an abrupt completion, return Completion(UpdateEmpty(R,
V)).
5. Return NormalCompletion(V).
--- |
2395 |
- |
| cptn-no-dflt-no-match.js |
---
es6id: 13.12.11
description: Completion value when no cases match
info: |
SwitchStatement : switch ( Expression ) CaseBlock
[...]
8. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
9. Set the running execution context’s LexicalEnvironment to oldEnv.
10. Return R.
13.12.9 Runtime Semantics: CaseBlockEvaluation
CaseBlock : { CaseClauses }
1. Let V = undefined.
2. Let A be the List of CaseClause items in CaseClauses, in source text
order.
3. Let found be false.
4. Repeat for each CaseClause C in A,
a. If found is false, then
i. Let clauseSelector be the result of CaseSelectorEvaluation of C.
ii. If clauseSelector is an abrupt completion, then
[...]
iii. Let found be the result of performing Strict Equality Comparison
input === clauseSelector.[[value]].
b. If found is true, then
[...]
5. Return NormalCompletion(V).
--- |
1374 |
- |
| S12.11_A1_T1.js |
---
info: |
If Result.type is break and Result.target is in the current
label set, return (normal, Result.value, empty)
es5id: 12.11_A1_T1
description: Simple test using switch statement
--- |
2029 |
- |
| S12.11_A1_T2.js |
---
info: |
If Result.type is break and Result.target is in the current
label set, return (normal, Result.value, empty)
es5id: 12.11_A1_T2
description: Switch with different types of variables
--- |
2336 |
- |
| S12.11_A1_T3.js |
---
info: |
If Result.type is break and Result.target is in the current
label set, return (normal, Result.value, empty)
es5id: 12.11_A1_T3
description: Using case with null, NaN, Infinity
--- |
2497 |
- |
| S12.11_A1_T4.js |
---
info: |
If Result.type is break and Result.target is in the current
label set, return (normal, Result.value, empty)
es5id: 12.11_A1_T4
description: Using case with isNaN and isNaN(value)
--- |
2206 |
- |
| S12.11_A2_T1.js |
---
info: There can be only one DefaultClause
es5id: 12.11_A2_T1
description: Duplicate DefaultClause
negative:
phase: parse
type: SyntaxError
--- |
544 |
- |
| S12.11_A3_T1.js |
---
info: Syntax constructions of switch statement
es5id: 12.11_A3_T1
description: Checking if execution of "switch() {}" fails
negative:
phase: parse
type: SyntaxError
--- |
519 |
- |
| S12.11_A3_T2.js |
---
info: Syntax constructions of switch statement
es5id: 12.11_A3_T2
description: Checking if execution of "switch {}" fails
negative:
phase: parse
type: SyntaxError
--- |
515 |
- |
| S12.11_A3_T3.js |
---
info: Syntax constructions of switch statement
es5id: 12.11_A3_T3
description: Checking if execution of "switch(value)" fails
negative:
phase: parse
type: SyntaxError
--- |
351 |
- |
| S12.11_A3_T4.js |
---
info: Syntax constructions of switch statement
es5id: 12.11_A3_T4
description: >
Using "case" that has no Expresson after it. "CaseClause: case
Expression : [StatementList]"
negative:
phase: parse
type: SyntaxError
--- |
580 |
- |
| S12.11_A3_T5.js |
---
info: Syntax constructions of switch statement
es5id: 12.11_A3_T5
description: Introducing statement not followed by "case" keyword
negative:
phase: parse
type: SyntaxError
--- |
546 |
- |
| S12.11_A4_T1.js |
---
info: Embedded syntax constructions of switch statement
es5id: 12.11_A4_T1
description: Nesting one "switch" statement into StatementList of the other's
--- |
768 |
- |
| scope-lex-async-function.js |
---
esid: sec-switch-statement-runtime-semantics-evaluation
description: Creation of new lexical environment (into `default` clause)
info: |
1. Let exprRef be the result of evaluating Expression.
2. Let switchValue be ? GetValue(exprRef).
3. Let oldEnv be the running execution context's LexicalEnvironment.
4. Let blockEnv be NewDeclarativeEnvironment(oldEnv).
5. Perform BlockDeclarationInstantiation(CaseBlock, blockEnv).
6. Set the running execution context's LexicalEnvironment to blockEnv.
7. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
[...]
negative:
phase: runtime
type: ReferenceError
--- |
873 |
- |
| scope-lex-async-generator.js |
---
esid: sec-switch-statement-runtime-semantics-evaluation
description: Creation of new lexical environment (into `default` clause)
info: |
1. Let exprRef be the result of evaluating Expression.
2. Let switchValue be ? GetValue(exprRef).
3. Let oldEnv be the running execution context's LexicalEnvironment.
4. Let blockEnv be NewDeclarativeEnvironment(oldEnv).
5. Perform BlockDeclarationInstantiation(CaseBlock, blockEnv).
6. Set the running execution context's LexicalEnvironment to blockEnv.
7. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
[...]
negative:
phase: runtime
type: ReferenceError
--- |
875 |
- |
| scope-lex-class.js |
---
esid: sec-switch-statement-runtime-semantics-evaluation
description: Creation of new lexical environment (into `default` clause)
info: |
1. Let exprRef be the result of evaluating Expression.
2. Let switchValue be ? GetValue(exprRef).
3. Let oldEnv be the running execution context's LexicalEnvironment.
4. Let blockEnv be NewDeclarativeEnvironment(oldEnv).
5. Perform BlockDeclarationInstantiation(CaseBlock, blockEnv).
6. Set the running execution context's LexicalEnvironment to blockEnv.
7. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
[...]
negative:
phase: runtime
type: ReferenceError
--- |
862 |
- |
| scope-lex-close-case.js |
---
esid: sec-switch-statement-runtime-semantics-evaluation
description: Removal of lexical environment (from `case` clause)
info: |
1. Let exprRef be the result of evaluating Expression.
2. Let switchValue be ? GetValue(exprRef).
3. Let oldEnv be the running execution context's LexicalEnvironment.
4. Let blockEnv be NewDeclarativeEnvironment(oldEnv).
5. Perform BlockDeclarationInstantiation(CaseBlock, blockEnv).
6. Set the running execution context's LexicalEnvironment to blockEnv.
7. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
[...]
features: [let]
--- |
1142 |
- |
| scope-lex-close-dflt.js |
---
esid: sec-switch-statement-runtime-semantics-evaluation
description: Removal of lexical environment (from `default` clause)
info: |
1. Let exprRef be the result of evaluating Expression.
2. Let switchValue be ? GetValue(exprRef).
3. Let oldEnv be the running execution context's LexicalEnvironment.
4. Let blockEnv be NewDeclarativeEnvironment(oldEnv).
5. Perform BlockDeclarationInstantiation(CaseBlock, blockEnv).
6. Set the running execution context's LexicalEnvironment to blockEnv.
7. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
[...]
features: [let]
--- |
1437 |
- |
| scope-lex-const.js |
---
esid: sec-switch-statement-runtime-semantics-evaluation
description: Creation of new lexical environment (into `default` clause)
info: |
1. Let exprRef be the result of evaluating Expression.
2. Let switchValue be ? GetValue(exprRef).
3. Let oldEnv be the running execution context's LexicalEnvironment.
4. Let blockEnv be NewDeclarativeEnvironment(oldEnv).
5. Perform BlockDeclarationInstantiation(CaseBlock, blockEnv).
6. Set the running execution context's LexicalEnvironment to blockEnv.
7. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
[...]
negative:
phase: runtime
type: ReferenceError
--- |
864 |
- |
| scope-lex-generator.js |
---
esid: sec-switch-statement-runtime-semantics-evaluation
description: Creation of new lexical environment (into `default` clause)
info: |
1. Let exprRef be the result of evaluating Expression.
2. Let switchValue be ? GetValue(exprRef).
3. Let oldEnv be the running execution context's LexicalEnvironment.
4. Let blockEnv be NewDeclarativeEnvironment(oldEnv).
5. Perform BlockDeclarationInstantiation(CaseBlock, blockEnv).
6. Set the running execution context's LexicalEnvironment to blockEnv.
7. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
[...]
negative:
phase: runtime
type: ReferenceError
--- |
869 |
- |
| scope-lex-let.js |
---
esid: sec-switch-statement-runtime-semantics-evaluation
description: Creation of new lexical environment (into `default` clause)
info: |
1. Let exprRef be the result of evaluating Expression.
2. Let switchValue be ? GetValue(exprRef).
3. Let oldEnv be the running execution context's LexicalEnvironment.
4. Let blockEnv be NewDeclarativeEnvironment(oldEnv).
5. Perform BlockDeclarationInstantiation(CaseBlock, blockEnv).
6. Set the running execution context's LexicalEnvironment to blockEnv.
7. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
[...]
negative:
phase: runtime
type: ReferenceError
--- |
864 |
- |
| scope-lex-open-case.js |
---
esid: sec-switch-statement-runtime-semantics-evaluation
description: Creation of new lexical environment (into `case` clause)
info: |
1. Let exprRef be the result of evaluating Expression.
2. Let switchValue be ? GetValue(exprRef).
3. Let oldEnv be the running execution context's LexicalEnvironment.
4. Let blockEnv be NewDeclarativeEnvironment(oldEnv).
5. Perform BlockDeclarationInstantiation(CaseBlock, blockEnv).
6. Set the running execution context's LexicalEnvironment to blockEnv.
7. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
[...]
features: [let]
--- |
1243 |
- |
| scope-lex-open-dflt.js |
---
esid: sec-switch-statement-runtime-semantics-evaluation
description: Creation of new lexical environment (into `default` clause)
info: |
1. Let exprRef be the result of evaluating Expression.
2. Let switchValue be ? GetValue(exprRef).
3. Let oldEnv be the running execution context's LexicalEnvironment.
4. Let blockEnv be NewDeclarativeEnvironment(oldEnv).
5. Perform BlockDeclarationInstantiation(CaseBlock, blockEnv).
6. Set the running execution context's LexicalEnvironment to blockEnv.
7. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
[...]
features: [let]
--- |
1055 |
- |
| scope-var-none-case.js |
---
esid: sec-switch-statement-runtime-semantics-evaluation
description: Retainment of existing variable environment (`case` clause)
info: |
1. Let exprRef be the result of evaluating Expression.
2. Let switchValue be ? GetValue(exprRef).
3. Let oldEnv be the running execution context's LexicalEnvironment.
4. Let blockEnv be NewDeclarativeEnvironment(oldEnv).
5. Perform BlockDeclarationInstantiation(CaseBlock, blockEnv).
6. Set the running execution context's LexicalEnvironment to blockEnv.
7. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
[...]
flags: [noStrict]
--- |
1441 |
- |
| scope-var-none-dflt.js |
---
esid: sec-switch-statement-runtime-semantics-evaluation
description: Retainment of existing variable environment (`default` clause)
info: |
1. Let exprRef be the result of evaluating Expression.
2. Let switchValue be ? GetValue(exprRef).
3. Let oldEnv be the running execution context's LexicalEnvironment.
4. Let blockEnv be NewDeclarativeEnvironment(oldEnv).
5. Perform BlockDeclarationInstantiation(CaseBlock, blockEnv).
6. Set the running execution context's LexicalEnvironment to blockEnv.
7. Let R be the result of performing CaseBlockEvaluation of CaseBlock with
argument switchValue.
[...]
flags: [noStrict]
--- |
1283 |
- |
| syntax |
|
|
- |
| tco-case-body-dflt.js |
---
description: Statement within statement is a candidate for tail-call optimization.
esid: sec-static-semantics-hascallintailposition
flags: [onlyStrict]
features: [tail-call-optimization]
includes: [tcoHelper.js]
--- |
554 |
- |
| tco-case-body.js |
---
description: Statement within statement is a candidate for tail-call optimization.
esid: sec-static-semantics-hascallintailposition
flags: [onlyStrict]
features: [tail-call-optimization]
includes: [tcoHelper.js]
--- |
545 |
- |
| tco-dftl-body.js |
---
description: Statement within statement is a candidate for tail-call optimization.
esid: sec-static-semantics-hascallintailposition
flags: [onlyStrict]
features: [tail-call-optimization]
includes: [tcoHelper.js]
--- |
546 |
- |