Skip to content
Snippets Groups Projects
Commit 37190a1d authored by Rick Waldron's avatar Rick Waldron
Browse files

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

parent 584b651e
No related branches found
No related tags found
No related merge requests found
...@@ -45,9 +45,7 @@ assert.sameValue( ...@@ -45,9 +45,7 @@ assert.sameValue(
"en-u-kn-true", "en-u-kn-true",
); );
if ("numeric" in Intl.Locale.prototype) { assert.sameValue(
assert.sameValue( new Intl.Locale('en-u-kf-lower', options).numeric,
new Intl.Locale('en-u-kf-lower', options).numeric, undefined,
undefined, );
);
}
...@@ -46,21 +46,21 @@ const validNumericOptions = [ ...@@ -46,21 +46,21 @@ const validNumericOptions = [
[{ valueOf() { return false; } }, true], [{ valueOf() { return false; } }, true],
]; ];
for (const [numeric, expected] of validNumericOptions) { for (const [numeric, expected] of validNumericOptions) {
const options = { numeric }; let options = { numeric };
let expect = `en-u-kn-${expected}`;
assert.sameValue( assert.sameValue(
new Intl.Locale('en', options).toString(), new Intl.Locale('en', options).toString(),
"en-u-kn-" + expected expect
); );
assert.sameValue( assert.sameValue(
new Intl.Locale('en-u-kn-true', options).toString(), new Intl.Locale('en-u-kn-true', options).toString(),
"en-u-kn-" + expected expect
); );
if ("numeric" in Intl.Locale.prototype) { assert.sameValue(
assert.sameValue( new Intl.Locale('en-u-kf-lower', options).numeric,
new Intl.Locale('en-u-kf-lower', options).numeric, expected
expected );
);
}
} }
...@@ -13,13 +13,10 @@ includes: [propertyHelper.js] ...@@ -13,13 +13,10 @@ includes: [propertyHelper.js]
features: [Intl.Locale] features: [Intl.Locale]
---*/ ---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "numeric"); const getter = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "numeric").get;
if (propdesc !== undefined) { verifyProperty(getter, "name", {
const getter = propdesc.get; value: "get numeric",
verifyProperty(getter, "name", { writable: false,
value: "get numeric", enumerable: false,
writable: false, configurable: true,
enumerable: false, });
configurable: true,
});
}
...@@ -16,12 +16,10 @@ features: [Intl.Locale] ...@@ -16,12 +16,10 @@ features: [Intl.Locale]
---*/ ---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "numeric"); const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "numeric");
if (propdesc) { assert.sameValue(propdesc.set, undefined);
assert.sameValue(propdesc.set, undefined); assert.sameValue(typeof propdesc.get, "function");
assert.sameValue(typeof propdesc.get, "function");
verifyProperty(Intl.Locale.prototype, "numeric", { verifyProperty(Intl.Locale.prototype, "numeric", {
enumerable: false, enumerable: false,
configurable: true, configurable: true,
}); });
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment