Change tests according to ecma402/pull/278 (#2031)

This commit is contained in:
Frank Yung-Fong Tang 2019-01-18 08:15:37 -08:00 committed by Leo Balter
parent d53256c971
commit 4f1155c566
4 changed files with 17 additions and 14 deletions

View File

@ -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,
});

View File

@ -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,
});

View File

@ -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,
});

View File

@ -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");
});