v8/test/intl/break-iterator/options.js
Sathya Gunasekaran 16f8417b66 [Intl] Convert options to an object in v8BreakIterator
Previously in the JS implementation, this would throw (on property
access) but this new behavior is more in line with how all the other
intl objects work.

Bug: v8:5751, chromium:880697
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I0bd073b2a0a6fc1eacd686083d8f1a72252cea53
Reviewed-on: https://chromium-review.googlesource.com/1207579
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55664}
2018-09-05 20:49:21 +00:00

14 lines
554 B
JavaScript

// Copyright 2018 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.
assertThrows(() => new Intl.v8BreakIterator('en', null));
assertDoesNotThrow(() => new Intl.v8BreakIterator('en', undefined));
for (let key of [false, true, "foo", Symbol, 1]) {
assertDoesNotThrow(() => new Intl.v8BreakIterator('en', key));
}
assertDoesNotThrow(() => new Intl.v8BreakIterator('en', {}));
assertDoesNotThrow(() => new Intl.v8BreakIterator('en', new Proxy({}, {})));