2018-09-18 14:27:40 +02:00
|
|
|
// Copyright 2018 Igalia, S.L. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
|
|
|
/*---
|
|
|
|
esid: sec-Intl.Locale
|
|
|
|
description: Checks the propagation of exceptions from the options for the Locale constructor.
|
|
|
|
features: [Intl.Locale]
|
|
|
|
---*/
|
|
|
|
|
|
|
|
function CustomError() {}
|
|
|
|
|
|
|
|
const options = [
|
|
|
|
"language",
|
|
|
|
"script",
|
|
|
|
"region",
|
|
|
|
"calendar",
|
|
|
|
"collation",
|
|
|
|
"hourCycle",
|
|
|
|
"caseFirst",
|
|
|
|
"numeric",
|
|
|
|
"numberingSystem",
|
|
|
|
];
|
|
|
|
|
|
|
|
for (const option of options) {
|
|
|
|
assert.throws(CustomError, () => {
|
|
|
|
new Intl.Locale("en", {
|
|
|
|
get [option]() {
|
|
|
|
throw new CustomError();
|
|
|
|
}
|
|
|
|
});
|
2018-10-03 16:24:38 +02:00
|
|
|
},
|
|
|
|
`new Intl.Locale("en", {get ${option}() {throw new CustomError();}}) throws CustomError`);
|
2018-09-18 14:27:40 +02:00
|
|
|
}
|