-
Notifications
You must be signed in to change notification settings - Fork 14
Removing spec text that entangles style: "unit" with style: "percent". #57
Conversation
how will this change observable behavior? |
You will no longer be able to combine style: "percent" with unitWidth: new Intl.NumberFormat(undefined, {
style: "percent",
unitDisplay: "long" // Read, but ignored.
});
new Intl.NumberFormat(undefined, {
style: "unit",
unit: "percent",
unitDisplay: "long" // This is OK
}); There should be no unit or unitDisplay field in resolvedOptions: new Intl.NumberFormat(undefined, {
style: "percent"
}).resolvedOptions();
// should NOT contain a unit or unitDisplay field percentSign is no longer allowed in formatToParts in style: "unit", but it is still OK in style: "percent": new Intl.NumberFormat(undefined, {
style: "unit",
unit: "percent"
}).formatToParts(100);
// Expected: [
// { type: "integer", value: "100" },
// { type: "unit", value: "%" }
// ] |
What is "unitWidth"? Do you mean "unitDisplay"?
What is "unitWidth"? Do you mean "unitDisplay"? |
Yes, sorry, my bad. Getting the ICU name mixed up with the 402 name. I'll edit my post |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
1. Sync with tc39/proposal-unified-intl-numberformat#57 so the formatting of {style: "unit" unit: "percent"} and the formatting of {style: "percent:"} are treated different that simplified the algorithm. 2. Store style into bit flags because we need it quickly during format. 3. Add more unit tests and regression test. Bug: v8:9498 Change-Id: I75ed22fef1feb73ebf624bda70ebe45b80e7bc8b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1704948 Reviewed-by: Adam Klein <adamk@chromium.org> Commit-Queue: Frank Tang <ftang@chromium.org> Cr-Commit-Position: refs/heads/master@{#62834}
Fixes #44