test262/test/built-ins/Object/entries/exception-during-enumeratio...

22 lines
530 B
JavaScript
Raw Normal View History

2015-11-22 07:52:49 +01:00
// Copyright (C) 2015 Jordan Harband. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Object.entries should terminate if getting a value throws an exception
es7id: pending
2015-11-22 07:52:49 +01:00
author: Jordan Harband
---*/
var trappedKey = {
get a() {
2015-12-14 21:20:14 +01:00
throw new RangeError('This error should be re-thrown');
2015-11-22 07:52:49 +01:00
},
get b() {
$ERROR('Should not try to get the second element');
}
};
2015-12-14 21:20:14 +01:00
assert.throws(RangeError, function () {
2015-11-22 07:52:49 +01:00
Object.entries(trappedKey);
});