| 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 |
$ERROR('Should not try to get the second element'); |
| 16 |
} |
| 17 |
}; |
| 18 |
|
| 19 |
assert.throws(RangeError, function() { |
| 20 |
Object.entries(trappedKey); |
| 21 |
}); |