mirror of
https://github.com/tc39/test262.git
synced 2025-07-27 07:54:41 +02:00
Use verifyProperty in remaining test/intl402 tests
This commit is contained in:
parent
f32dc36f3e
commit
99096762ca
@ -24,8 +24,9 @@ info: |
|
|||||||
includes: [propertyHelper.js]
|
includes: [propertyHelper.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
assert.sameValue(Date.prototype.toLocaleDateString.length, 0);
|
verifyProperty(Date.prototype.toLocaleDateString, "length", {
|
||||||
|
value: 0,
|
||||||
verifyNotEnumerable(Date.prototype.toLocaleDateString, "length");
|
writable: false,
|
||||||
verifyNotWritable(Date.prototype.toLocaleDateString, "length");
|
enumerable: false,
|
||||||
verifyConfigurable(Date.prototype.toLocaleDateString, "length");
|
configurable: true,
|
||||||
|
});
|
||||||
|
@ -24,8 +24,9 @@ info: |
|
|||||||
includes: [propertyHelper.js]
|
includes: [propertyHelper.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
assert.sameValue(Date.prototype.toLocaleString.length, 0);
|
verifyProperty(Date.prototype.toLocaleString, "length", {
|
||||||
|
value: 0,
|
||||||
verifyNotEnumerable(Date.prototype.toLocaleString, "length");
|
writable: false,
|
||||||
verifyNotWritable(Date.prototype.toLocaleString, "length");
|
enumerable: false,
|
||||||
verifyConfigurable(Date.prototype.toLocaleString, "length");
|
configurable: true,
|
||||||
|
});
|
||||||
|
@ -24,8 +24,9 @@ info: |
|
|||||||
includes: [propertyHelper.js]
|
includes: [propertyHelper.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
assert.sameValue(Date.prototype.toLocaleTimeString.length, 0);
|
verifyProperty(Date.prototype.toLocaleTimeString, "length", {
|
||||||
|
value: 0,
|
||||||
verifyNotEnumerable(Date.prototype.toLocaleTimeString, "length");
|
writable: false,
|
||||||
verifyNotWritable(Date.prototype.toLocaleTimeString, "length");
|
enumerable: false,
|
||||||
verifyConfigurable(Date.prototype.toLocaleTimeString, "length");
|
configurable: true,
|
||||||
|
});
|
||||||
|
@ -25,6 +25,8 @@ features: [Intl.DurationFormat]
|
|||||||
includes: [propertyHelper.js]
|
includes: [propertyHelper.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
verifyNotEnumerable(Intl.DurationFormat.prototype, "constructor");
|
verifyProperty(Intl.DurationFormat.prototype, "constructor", {
|
||||||
verifyWritable(Intl.DurationFormat.prototype, "constructor");
|
writable: true,
|
||||||
verifyConfigurable(Intl.DurationFormat.prototype, "constructor");
|
enumerable: false,
|
||||||
|
configurable: true,
|
||||||
|
});
|
||||||
|
@ -10,6 +10,9 @@ features: [Intl.DurationFormat]
|
|||||||
includes: [propertyHelper.js]
|
includes: [propertyHelper.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
verifyNotEnumerable(Intl.DurationFormat, "prototype");
|
verifyProperty(Intl.DurationFormat, "prototype", {
|
||||||
verifyNotWritable(Intl.DurationFormat, "prototype");
|
value: Intl.DurationFormat.prototype,
|
||||||
verifyNotConfigurable(Intl.DurationFormat, "prototype");
|
writable: false,
|
||||||
|
enumerable: false,
|
||||||
|
configurable: false,
|
||||||
|
});
|
||||||
|
@ -17,6 +17,8 @@ assert.sameValue(
|
|||||||
'`typeof Intl.getCanonicalLocales` is `function`'
|
'`typeof Intl.getCanonicalLocales` is `function`'
|
||||||
);
|
);
|
||||||
|
|
||||||
verifyNotEnumerable(Intl, 'getCanonicalLocales');
|
verifyProperty(Intl, "getCanonicalLocales", {
|
||||||
verifyWritable(Intl, 'getCanonicalLocales');
|
writable: true,
|
||||||
verifyConfigurable(Intl, 'getCanonicalLocales');
|
enumerable: false,
|
||||||
|
configurable: true,
|
||||||
|
});
|
||||||
|
@ -11,8 +11,9 @@ info: |
|
|||||||
includes: [propertyHelper.js]
|
includes: [propertyHelper.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
assert.sameValue(Intl.getCanonicalLocales.length, 1);
|
verifyProperty(Intl.getCanonicalLocales, "length", {
|
||||||
|
value: 1,
|
||||||
verifyNotEnumerable(Intl.getCanonicalLocales, "length");
|
writable: false,
|
||||||
verifyNotWritable(Intl.getCanonicalLocales, "length");
|
enumerable: false,
|
||||||
verifyConfigurable(Intl.getCanonicalLocales, "length");
|
configurable: true,
|
||||||
|
});
|
||||||
|
@ -11,10 +11,9 @@ info: |
|
|||||||
includes: [propertyHelper.js]
|
includes: [propertyHelper.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
assert.sameValue(Intl.getCanonicalLocales.name, 'getCanonicalLocales',
|
verifyProperty(Intl.getCanonicalLocales, "name", {
|
||||||
'The value of `Intl.getCanonicalLocales.name` is `"getCanonicalLocales"`'
|
value: "getCanonicalLocales",
|
||||||
);
|
writable: false,
|
||||||
|
enumerable: false,
|
||||||
verifyNotEnumerable(Intl.getCanonicalLocales, 'name');
|
configurable: true,
|
||||||
verifyNotWritable(Intl.getCanonicalLocales, 'name');
|
});
|
||||||
verifyConfigurable(Intl.getCanonicalLocales, 'name');
|
|
||||||
|
@ -14,22 +14,34 @@ includes: [propertyHelper.js]
|
|||||||
var locales = ['en-US', 'fr'];
|
var locales = ['en-US', 'fr'];
|
||||||
var result = Intl.getCanonicalLocales(locales);
|
var result = Intl.getCanonicalLocales(locales);
|
||||||
|
|
||||||
verifyEnumerable(result, 0);
|
verifyProperty(result, 0, {
|
||||||
verifyWritable(result, 0);
|
value: 'en-US',
|
||||||
verifyConfigurable(result, 0);
|
writable: true,
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true,
|
||||||
|
});
|
||||||
|
|
||||||
result = Intl.getCanonicalLocales(locales);
|
result = Intl.getCanonicalLocales(locales);
|
||||||
verifyEnumerable(result, 1);
|
|
||||||
verifyWritable(result, 1);
|
verifyProperty(result, 1, {
|
||||||
verifyConfigurable(result, 1);
|
value: 'fr',
|
||||||
|
writable: true,
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true,
|
||||||
|
});
|
||||||
|
|
||||||
result = Intl.getCanonicalLocales(locales);
|
result = Intl.getCanonicalLocales(locales);
|
||||||
verifyNotEnumerable(result, 'length');
|
|
||||||
verifyNotConfigurable(result, 'length');
|
|
||||||
|
|
||||||
assert.sameValue(result.length, 2);
|
verifyProperty(result, "length", {
|
||||||
|
value: 2,
|
||||||
|
writable: true,
|
||||||
|
enumerable: false,
|
||||||
|
configurable: false,
|
||||||
|
});
|
||||||
|
|
||||||
result.length = 42;
|
result.length = 42;
|
||||||
assert.sameValue(result.length, 42);
|
assert.sameValue(result.length, 42);
|
||||||
|
|
||||||
assert.throws(RangeError, function() {
|
assert.throws(RangeError, function() {
|
||||||
result.length = "Leo";
|
result.length = "Leo";
|
||||||
}, "a non-numeric value can't be set to result.length");
|
}, "a non-numeric value can't be set to result.length");
|
||||||
|
@ -24,8 +24,9 @@ info: |
|
|||||||
includes: [propertyHelper.js]
|
includes: [propertyHelper.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
assert.sameValue(String.prototype.localeCompare.length, 1);
|
verifyProperty(String.prototype.localeCompare, "length", {
|
||||||
|
value: 1,
|
||||||
verifyNotEnumerable(String.prototype.localeCompare, "length");
|
writable: false,
|
||||||
verifyNotWritable(String.prototype.localeCompare, "length");
|
enumerable: false,
|
||||||
verifyConfigurable(String.prototype.localeCompare, "length");
|
configurable: true,
|
||||||
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user