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.
|
|
|
|
|
|
|
|
/*---
|
2016-02-04 22:12:53 +01:00
|
|
|
id: sec-object.entries
|
2015-11-22 07:52:49 +01:00
|
|
|
description: Object.entries should terminate if getting a value throws an exception
|
|
|
|
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);
|
|
|
|
});
|