From 94b1e80ab3440413df916cd56d29c5a2fa2ac451 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Wed, 20 Jun 2018 16:09:55 +0200 Subject: [PATCH] Intl.RelativeTimeFormat: Add a test for the return value of supportedLocalesOf() --- .../supportedLocalesOf/result-type.js | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/result-type.js diff --git a/test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/result-type.js b/test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/result-type.js new file mode 100644 index 0000000000..809a4a694a --- /dev/null +++ b/test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/result-type.js @@ -0,0 +1,34 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat.supportedLocalesOf +description: Verifies the type of the return value of Intl.RelativeTimeFormat.supportedLocalesOf(). +info: | + Intl.RelativeTimeFormat.supportedLocalesOf ( locales [, options ]) +includes: [propertyHelper.js] +features: [Intl.RelativeTimeFormat] +---*/ + +const result = Intl.RelativeTimeFormat.supportedLocalesOf("en"); +assert.sameValue(Array.isArray(result), true, + "Array.isArray() should return true"); +assert.sameValue(Object.getPrototypeOf(result), Array.prototype, + "The prototype should be Array.prototype"); +assert.sameValue(Object.isExtensible(result), true, + "Object.isExtensible() should return true"); + +assert.notSameValue(result.length, 0); +for (let i = 0; i < result.length; ++i) { + verifyProperty(result, String(i), { + "writable": false, + "enumerable": true, + "configurable": false, + }); +} + +verifyProperty(result, "length", { + "writable": false, + "enumerable": false, + "configurable": false, +});