diff options
Diffstat (limited to 'js/src/tests/test262/intl402/RelativeTimeFormat/constructor/constructor/options-toobject.js')
-rw-r--r-- | js/src/tests/test262/intl402/RelativeTimeFormat/constructor/constructor/options-toobject.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/RelativeTimeFormat/constructor/constructor/options-toobject.js b/js/src/tests/test262/intl402/RelativeTimeFormat/constructor/constructor/options-toobject.js new file mode 100644 index 0000000000..872308d078 --- /dev/null +++ b/js/src/tests/test262/intl402/RelativeTimeFormat/constructor/constructor/options-toobject.js @@ -0,0 +1,28 @@ +// 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 +description: Checks handling of non-object option arguments to the RelativeTimeFormat constructor. +info: | + InitializeRelativeTimeFormat (relativeTimeFormat, locales, options) +features: [Intl.RelativeTimeFormat] +---*/ + +const optionsArguments = [ + true, + "test", + 7, + Symbol(), +]; + +for (const options of optionsArguments) { + const rtf = new Intl.RelativeTimeFormat([], options); + const resolvedOptions = rtf.resolvedOptions(); + assert.sameValue(resolvedOptions.style, "long", + `options argument ${String(options)} should yield the correct value for "style"`); + assert.sameValue(resolvedOptions.numeric, "always", + `options argument ${String(options)} should yield the correct value for "numeric"`); +} + +reportCompare(0, 0); |