test262/test/intl402/Locale/getters-privateuse.js

29 lines
1006 B
JavaScript
Raw Normal View History

2018-05-11 10:33:32 +02:00
// Copyright 2018 André Bargull; Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-intl.locale
description: >
Verifies getters with privateuse tags.
info: |
get Intl.Locale.prototype.baseName
4. If locale does not match the langtag production, return locale.
get Intl.Locale.prototype.language
2018-10-17 16:45:33 +02:00
4. If locale matches the privateuse or the grandfathered production, return locale.
2018-05-11 10:33:32 +02:00
get Intl.Locale.prototype.script
4. If locale matches the privateuse or the grandfathered production, return undefined.
get Intl.Locale.prototype.region
4. If locale matches the privateuse or the grandfathered production, return undefined.
features: [Intl.Locale]
---*/
// Privateuse only language tag.
var loc = new Intl.Locale("x-private");
assert.sameValue(loc.baseName, "x-private");
2018-10-17 16:45:33 +02:00
assert.sameValue(loc.language, "x-private");
2018-05-11 10:33:32 +02:00
assert.sameValue(loc.script, undefined);
assert.sameValue(loc.region, undefined);