Intl.Locale.prototype.numeric: the feature is not optional, therefore the tests are not optional

This commit is contained in:
Rick Waldron 2018-09-26 11:06:03 -04:00
parent 584b651edf
commit 37190a1deb
4 changed files with 26 additions and 33 deletions

View File

@ -45,9 +45,7 @@ assert.sameValue(
"en-u-kn-true",
);
if ("numeric" in Intl.Locale.prototype) {
assert.sameValue(
new Intl.Locale('en-u-kf-lower', options).numeric,
undefined,
);
}
assert.sameValue(
new Intl.Locale('en-u-kf-lower', options).numeric,
undefined,
);

View File

@ -46,21 +46,21 @@ const validNumericOptions = [
[{ valueOf() { return false; } }, true],
];
for (const [numeric, expected] of validNumericOptions) {
const options = { numeric };
let options = { numeric };
let expect = `en-u-kn-${expected}`;
assert.sameValue(
new Intl.Locale('en', options).toString(),
"en-u-kn-" + expected
expect
);
assert.sameValue(
new Intl.Locale('en-u-kn-true', options).toString(),
"en-u-kn-" + expected
expect
);
if ("numeric" in Intl.Locale.prototype) {
assert.sameValue(
new Intl.Locale('en-u-kf-lower', options).numeric,
expected
);
}
assert.sameValue(
new Intl.Locale('en-u-kf-lower', options).numeric,
expected
);
}

View File

@ -13,13 +13,10 @@ includes: [propertyHelper.js]
features: [Intl.Locale]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "numeric");
if (propdesc !== undefined) {
const getter = propdesc.get;
verifyProperty(getter, "name", {
value: "get numeric",
writable: false,
enumerable: false,
configurable: true,
});
}
const getter = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "numeric").get;
verifyProperty(getter, "name", {
value: "get numeric",
writable: false,
enumerable: false,
configurable: true,
});

View File

@ -16,12 +16,10 @@ features: [Intl.Locale]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "numeric");
if (propdesc) {
assert.sameValue(propdesc.set, undefined);
assert.sameValue(typeof propdesc.get, "function");
assert.sameValue(propdesc.set, undefined);
assert.sameValue(typeof propdesc.get, "function");
verifyProperty(Intl.Locale.prototype, "numeric", {
enumerable: false,
configurable: true,
});
}
verifyProperty(Intl.Locale.prototype, "numeric", {
enumerable: false,
configurable: true,
});