cptn-finally-empty-continue.js (739B)
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 Finally 10 ... 11 2. Let F be the result of evaluating Finally. 12 ... 13 4. 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 {} finally { continue; } } 'bad completion'; }"); 18 assert.sameValue(completion, undefined); 19 20 reportCompare(0, 0);