From 4f1155c566a222238fd86f179c6635ecb4c289bb Mon Sep 17 00:00:00 2001
From: Frank Yung-Fong Tang <41213225+FrankYFTang@users.noreply.github.com>
Date: Fri, 18 Jan 2019 08:15:37 -0800
Subject: [PATCH] Change tests according to ecma402/pull/278 (#2031)

---
 .../supportedLocalesOf/result-type.js            |  5 ++---
 .../supportedLocalesOf/result-type.js            |  5 ++---
 .../supportedLocalesOf/result-type.js            |  5 ++---
 ...Of-returned-array-elements-are-not-frozen.js} | 16 +++++++++++-----
 4 files changed, 17 insertions(+), 14 deletions(-)
 rename test/intl402/{supportedLocalesOf-returned-array-elements-are-frozen.js => supportedLocalesOf-returned-array-elements-are-not-frozen.js} (55%)

diff --git a/test/intl402/ListFormat/constructor/supportedLocalesOf/result-type.js b/test/intl402/ListFormat/constructor/supportedLocalesOf/result-type.js
index 4f5eaf2399..1d9f11321c 100644
--- a/test/intl402/ListFormat/constructor/supportedLocalesOf/result-type.js
+++ b/test/intl402/ListFormat/constructor/supportedLocalesOf/result-type.js
@@ -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,
 });
diff --git a/test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/result-type.js b/test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/result-type.js
index 809a4a694a..a4f590fe9c 100644
--- a/test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/result-type.js
+++ b/test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/result-type.js
@@ -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,
 });
diff --git a/test/intl402/Segmenter/constructor/supportedLocalesOf/result-type.js b/test/intl402/Segmenter/constructor/supportedLocalesOf/result-type.js
index 9005b99160..98d5403ec7 100644
--- a/test/intl402/Segmenter/constructor/supportedLocalesOf/result-type.js
+++ b/test/intl402/Segmenter/constructor/supportedLocalesOf/result-type.js
@@ -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,
 });
diff --git a/test/intl402/supportedLocalesOf-returned-array-elements-are-frozen.js b/test/intl402/supportedLocalesOf-returned-array-elements-are-not-frozen.js
similarity index 55%
rename from test/intl402/supportedLocalesOf-returned-array-elements-are-frozen.js
rename to test/intl402/supportedLocalesOf-returned-array-elements-are-not-frozen.js
index 0244c2e54a..09f11e7790 100644
--- a/test/intl402/supportedLocalesOf-returned-array-elements-are-frozen.js
+++ b/test/intl402/supportedLocalesOf-returned-array-elements-are-not-frozen.js
@@ -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");
 });
-- 
GitLab