mirror of
https://github.com/nodejs/node.git
synced 2025-05-17 08:05:29 +00:00

PR-URL: https://github.com/nodejs/node/pull/38273 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Mary Marchini <oss@mmarchini.me>
21 lines
625 B
JavaScript
21 lines
625 B
JavaScript
// Copyright 2021 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
// Test Intl.Segmenter call GetOptionsObject instead of ToObject
|
|
// https://tc39.es/ecma402/#sec-getoptionsobject
|
|
// https://tc39.es/ecma262/#sec-toobject
|
|
let testCases = [
|
|
null, // Null
|
|
true, // Boolean
|
|
false, // Boolean
|
|
1234, // Number
|
|
"string", // String
|
|
Symbol('foo'), // Symbol
|
|
9007199254740991n // BigInt
|
|
];
|
|
|
|
testCases.forEach(function (testCase) {
|
|
assertThrows(() => new Intl.Segmenter("en", testCase), TypeError);
|
|
});
|