tor-browser

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

exception-during-enumeration.js (559B)


      1 // Copyright (C) 2015 Jordan Harband. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 esid: sec-object.entries
      6 description: Object.entries should terminate if getting a value throws an exception
      7 author: Jordan Harband
      8 ---*/
      9 
     10 var trappedKey = {
     11  get a() {
     12    throw new RangeError('This error should be re-thrown');
     13  },
     14  get b() {
     15    throw new Test262Error('Should not try to get the second element');
     16  }
     17 };
     18 
     19 assert.throws(RangeError, function() {
     20  Object.entries(trappedKey);
     21 });
     22 
     23 reportCompare(0, 0);