mirror of https://github.com/tc39/test262.git
25 lines
647 B
JavaScript
25 lines
647 B
JavaScript
|
// 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-fractionalSecondDigits]
|
||
|
---*/
|
||
|
|
||
|
function CustomError() {}
|
||
|
|
||
|
const options = [
|
||
|
"fractionalSecondDigits",
|
||
|
];
|
||
|
|
||
|
for (const option of options) {
|
||
|
assert.throws(CustomError, () => {
|
||
|
new Intl.DateTimeFormat("en", {
|
||
|
get [option]() {
|
||
|
throw new CustomError();
|
||
|
}
|
||
|
});
|
||
|
}, `Exception from ${option} getter should be propagated`);
|
||
|
}
|