test262/test/intl402/DisplayNames/options-getoptionsobject.js
Frank Yung-Fong Tang 31126581e7
Change Intl.(ListFormat|DisplayNames|Segmenter) (#2952)
* Change Intl.(ListFormat|DisplayNames|Segmenter)

Sync from ToObject to GetOptionsObject which throw TypeError
while the option is not object

* Add null and false to test
2021-03-08 19:31:26 -08:00

25 lines
565 B
JavaScript

// Copyright 2021 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.DisplayNames
description: Checks handling of non-object option arguments to the DisplayNames constructor.
info: |
Intl.DisplayNames ( locales, options )
features: [Intl.DisplayNames,BigInt]
---*/
const optionsArguments = [
null,
true,
false,
"test",
7,
Symbol(),
123456789n,
];
for (const options of optionsArguments) {
assert.throws(TypeError, function() { new Intl.DisplayNames([], options) })
}