exception-during-enumeration.js (556B)
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.values 6 description: Object.values 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.values(trappedKey); 21 }); 22 23 reportCompare(0, 0);