mirror of https://github.com/tc39/test262.git
Intl.Locale.prototype.numeric: the feature is not optional, therefore the tests are not optional
This commit is contained in:
parent
584b651edf
commit
37190a1deb
|
@ -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 = [
|
||||||
[{ 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]
|
||||||
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) {
|
|
||||||
const getter = propdesc.get;
|
|
||||||
verifyProperty(getter, "name", {
|
verifyProperty(getter, "name", {
|
||||||
value: "get numeric",
|
value: "get numeric",
|
||||||
writable: false,
|
writable: false,
|
||||||
enumerable: false,
|
enumerable: false,
|
||||||
configurable: true,
|
configurable: true,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ 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");
|
||||||
|
|
||||||
|
@ -24,4 +23,3 @@ if (propdesc) {
|
||||||
enumerable: false,
|
enumerable: false,
|
||||||
configurable: true,
|
configurable: true,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue