Debian Codegraph @

js/src/tests/test262/language/statements/try/cptn-catch-finally-empty-break.js

raw
1 // Copyright (C) 2017 André Bargull. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 esid: sec-try-statement-runtime-semantics-evaluation
6 description: Abrupt completion from finally block calls UpdatEmpty()
7 info: |
8 13.15.8 Runtime Semantics: Evaluation
9 TryStatement : try Block Catch Finally
10 ...
11 4. Let F be the result of evaluating Finally.
12 ...
13 6. Return Completion(UpdateEmpty(F, undefined)).
14 ---*/
15
16 // Ensure the completion value from the first iteration ('bad completion') is not returned.
17 var completion = eval("for (var i = 0; i < 2; ++i) { if (i) { try { throw null; } catch (e) {} finally { break; } } 'bad completion'; }");
18 assert.sameValue(completion, undefined);
19
20 reportCompare(0, 0);