From 4bd382c5df206f328b35ca23579904f603b84f0b Mon Sep 17 00:00:00 2001 From: Jason Stafford Date: Fri, 2 Feb 2018 15:49:46 -0800 Subject: [PATCH] fix failing test (Property length of object returned by SupportedLocales is writable) (#298) --- src/9.negotiation.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/9.negotiation.js b/src/9.negotiation.js index b2d75d650..9740a07e7 100644 --- a/src/9.negotiation.js +++ b/src/9.negotiation.js @@ -607,8 +607,16 @@ export function /*9.2.8 */SupportedLocales (availableLocales, requestedLocales, writable: false, configurable: false, value: subset[P] }); } - - // 5. Return subset + + // 5. repeat the above operation for the length property, + // since length is not enumerable in a List. + // This is by design as it matches the behavior of Array. + defineProperty(subset, 'length', { + writable: false, configurable: false, value: subset.length + }); + + + // 6. Return subset return subset; }