mirror of https://github.com/tc39/test262.git
Change tests according to ecma402/pull/278 (#2031)
This commit is contained in:
parent
d53256c971
commit
4f1155c566
|
@ -21,14 +21,13 @@ assert.sameValue(Object.isExtensible(result), true,
|
|||
assert.notSameValue(result.length, 0);
|
||||
for (let i = 0; i < result.length; ++i) {
|
||||
verifyProperty(result, String(i), {
|
||||
"writable": false,
|
||||
"writable": true,
|
||||
"enumerable": true,
|
||||
"configurable": false,
|
||||
"configurable": true,
|
||||
});
|
||||
}
|
||||
|
||||
verifyProperty(result, "length", {
|
||||
"writable": false,
|
||||
"enumerable": false,
|
||||
"configurable": false,
|
||||
});
|
||||
|
|
|
@ -21,14 +21,13 @@ assert.sameValue(Object.isExtensible(result), true,
|
|||
assert.notSameValue(result.length, 0);
|
||||
for (let i = 0; i < result.length; ++i) {
|
||||
verifyProperty(result, String(i), {
|
||||
"writable": false,
|
||||
"writable": true,
|
||||
"enumerable": true,
|
||||
"configurable": false,
|
||||
"configurable": true,
|
||||
});
|
||||
}
|
||||
|
||||
verifyProperty(result, "length", {
|
||||
"writable": false,
|
||||
"enumerable": false,
|
||||
"configurable": false,
|
||||
});
|
||||
|
|
|
@ -21,14 +21,13 @@ assert.sameValue(Object.isExtensible(result), true,
|
|||
assert.notSameValue(result.length, 0);
|
||||
for (let i = 0; i < result.length; ++i) {
|
||||
verifyProperty(result, String(i), {
|
||||
"writable": false,
|
||||
"writable": true,
|
||||
"enumerable": true,
|
||||
"configurable": false,
|
||||
"configurable": true,
|
||||
});
|
||||
}
|
||||
|
||||
verifyProperty(result, "length", {
|
||||
"writable": false,
|
||||
"enumerable": false,
|
||||
"configurable": false,
|
||||
});
|
||||
|
|
|
@ -5,14 +5,20 @@
|
|||
es5id: 9.2.8_4
|
||||
description: >
|
||||
Tests that the array returned by SupportedLocales is extensible,
|
||||
but its properties are non-writable/non-configurable.
|
||||
writable and configurable.
|
||||
author: Norbert Lindenberg
|
||||
includes: [testIntl.js]
|
||||
---*/
|
||||
|
||||
function testFrozenProperty(obj, property) {
|
||||
function testNormalProperty(obj, property) {
|
||||
var desc = Object.getOwnPropertyDescriptor(obj, property);
|
||||
assert.sameValue(desc.writable, false, "Property " + property + " of object returned by SupportedLocales is writable.");
|
||||
assert.sameValue(desc.writable, true, "Property " + property + " of object returned by SupportedLocales is not writable.");
|
||||
assert.sameValue(desc.configurable, true, "Property " + property + " of object returned by SupportedLocales is not configurable.");
|
||||
}
|
||||
|
||||
function testLengthProperty(obj, property) {
|
||||
var desc = Object.getOwnPropertyDescriptor(obj, property);
|
||||
assert.sameValue(desc.writable, true, "Property " + property + " of object returned by SupportedLocales is not writable.");
|
||||
assert.sameValue(desc.configurable, false, "Property " + property + " of object returned by SupportedLocales is configurable.");
|
||||
}
|
||||
|
||||
|
@ -21,7 +27,7 @@ testWithIntlConstructors(function (Constructor) {
|
|||
var supported = Constructor.supportedLocalesOf([defaultLocale]);
|
||||
assert(Object.isExtensible(supported), "Object returned by SupportedLocales is not extensible.");
|
||||
for (var i = 0; i < supported.length; i++) {
|
||||
testFrozenProperty(supported, i);
|
||||
testNormalProperty(supported, i);
|
||||
}
|
||||
testFrozenProperty(supported, "length");
|
||||
testLengthProperty(supported, "length");
|
||||
});
|
Loading…
Reference in New Issue