-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged: [Intl] Fix numberingSystem for NumberFormat
Revision: 157af78 BUG=v8:8525 LOG=N NOTRY=true NOPRESUBMIT=true NOTREECHECKS=true [email protected] Change-Id: I56787a43596dce96f78d33de9aba0a369428fd17 Reviewed-on: https://chromium-review.googlesource.com/c/1370012 Reviewed-by: Adam Klein <[email protected]> Cr-Commit-Position: refs/branch-heads/7.2@{v8#17} Cr-Branched-From: 6acd03c-refs/heads/7.2.502@{#1} Cr-Branched-From: b03041d-refs/heads/master@{#57910}
- Loading branch information
1 parent
d62c730
commit e7ceacc
Showing
3 changed files
with
31 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// 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. | ||
|
||
// test the numberingSystem is set correctly via -u-nu- | ||
let dtf = new Intl.DateTimeFormat(["en-u-ba-rfoo-nu-arab-fo-obar"]); | ||
assertEquals("arab", dtf.resolvedOptions().numberingSystem); | ||
assertEquals("en-u-nu-arab", dtf.resolvedOptions().locale); | ||
|
||
let nf = new Intl.NumberFormat(["en-u-ba-rfoo-nu-arab-fo-obar"]); | ||
assertEquals("arab", nf.resolvedOptions().numberingSystem); | ||
assertEquals("١٢٣", nf.format(123)); | ||
assertEquals("en-u-nu-arab", nf.resolvedOptions().locale); | ||
|
||
dtf = new Intl.DateTimeFormat(["en-u-ba-rfoo-nu-thai-fo-obar"]); | ||
assertEquals("thai", dtf.resolvedOptions().numberingSystem); | ||
assertEquals("en-u-nu-thai", dtf.resolvedOptions().locale); | ||
|
||
nf = new Intl.NumberFormat(["en-u-ba-rfoo-nu-thai-fo-obar"]); | ||
assertEquals("thai", nf.resolvedOptions().numberingSystem); | ||
assertEquals("๑๒๓", nf.format(123)); | ||
assertEquals("en-u-nu-thai", nf.resolvedOptions().locale); | ||
|
||
nf = new Intl.NumberFormat(["ar-EG-u-nu-latn"]); | ||
assertEquals("latn", nf.resolvedOptions().numberingSystem); | ||
assertEquals("123", nf.format(123)); | ||
assertEquals("ar-EG-u-nu-latn", nf.resolvedOptions().locale); |