blob: 0c84cfe0fa6658ca9759327c34ac52fd67c5aec5 [file] [log] [blame]
// Copyright 2019 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-initializedatetimeformat
description: Checks the propagation of exceptions from the options for the DateTimeFormat constructor.
features: [Intl.DateTimeFormat-dayPeriod]
---*/
function CustomError() {}
const options = [
"dayPeriod",
];
for (const option of options) {
assert.throws(CustomError, () => {
new Intl.DateTimeFormat("en", {
get [option]() {
throw new CustomError();
}
});
}, `Exception from ${option} getter should be propagated`);
}