Test change in PluralRules default options semantics (#1350)

The change is done in the following patch, where default options
have a null prototype. This matches what other Intl objects have.
1abe8af440
This commit is contained in:
Daniel Ehrenberg 2017-11-21 11:13:44 -08:00 committed by Leo Balter
parent fe1b7e2a74
commit 1702336a77
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
// Copyright (C) 2017 Igalia, S. L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-initializepluralrules
description: >
Monkey-patching Object.prototype does not change the default
options for PluralRules as a null prototype is used.
info: >
InitializePluralRules ( collator, locales, options )
1. If _options_ is *undefined*, then
1. Let _options_ be ObjectCreate(*null*).
---*/
Object.prototype.type = "ordinal";
let pluralRules = new Intl.PluralRules("en");
assert.sameValue(pluralRules.resolvedOptions().type, "cardinal");