tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

cptn-catch-empty-continue.js (799B)


      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 catch block calls UpdatEmpty()
      7 info: |
      8  13.15.8 Runtime Semantics: Evaluation
      9  TryStatement : try Block Catch
     10    ...
     11    2. If B.[[Type]] is throw, let C be CatchClauseEvaluation of Catch with parameter B.[[Value]].
     12    ...
     13    4. Return Completion(UpdateEmpty(C, 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) { continue; } } 'bad completion'; }");
     18 assert.sameValue(completion, undefined);
     19 
     20 reportCompare(0, 0);