|
140 | 140 | 1. Let _pr_ be the *this* value.
|
141 | 141 | 1. Perform ? RequireInternalSlot(_pr_, [[InitializedPluralRules]]).
|
142 | 142 | 1. Let _n_ be ? ToNumber(_value_).
|
143 |
| - 1. Return ! ResolvePlural(_pr_, _n_). |
| 143 | + 1. Return ! ResolvePlural(_pr_, _n_)<ins>.[[PluralCategory]]</ins>. |
144 | 144 | </emu-alg>
|
145 | 145 | </emu-clause>
|
146 | 146 |
|
|
373 | 373 | <emu-clause id="sec-resolveplural" aoid="ResolvePlural">
|
374 | 374 | <h1>ResolvePlural ( _pluralRules_, _n_ )</h1>
|
375 | 375 | <p>
|
376 |
| - When the ResolvePlural abstract operation is called with arguments _pluralRules_ (which must be an object initialized as a PluralRules) and _n_ (which must be a Number value), it returns a String value representing the plural form of _n_ according to the effective locale and the options of _pluralRules_. The following steps are taken: |
| 376 | + When the ResolvePlural abstract operation is called with arguments _pluralRules_ (which must be an object initialized as a PluralRules) and _n_ (which must be a Number value), it returns <ins>a Record containing two values:</ins> a String value representing the plural form of _n_ according to the effective locale and the options of _pluralRules_ <ins>in the field [[PluralCategory]], and _n_ as a formatted string in the field [[FormattedString]]</ins>. The following steps are taken: |
377 | 377 | </p>
|
378 | 378 |
|
379 | 379 | <emu-alg>
|
|
387 | 387 | 1. Let _res_ be ! FormatNumericToString(_pluralRules_, _n_).
|
388 | 388 | 1. Let _s_ be _res_.[[FormattedString]].
|
389 | 389 | 1. Let _operands_ be ! GetOperands(_s_).
|
390 |
| - 1. Return ! PluralRuleSelect(_locale_, _type_, _n_, _operands_). |
| 390 | + 1. <del>Return</del> <ins>Let _p_ be</ins> ! PluralRuleSelect(_locale_, _type_, _n_, _operands_). |
| 391 | + 1. <ins class="block">Return the Record { [[PluralCategory]]: _p_, [[FormattedString]]: _s_ }.</ins> |
391 | 392 | </emu-alg>
|
392 | 393 | </emu-clause>
|
393 | 394 |
|
|
414 | 415 | 1. If _x_ is *NaN* or _y_ is *NaN*, throw a *RangeError* exception.
|
415 | 416 | 1. Let _xp_ be ! ResolvePlural(_pluralRules_, _x_).
|
416 | 417 | 1. Let _yp_ be ! ResolvePlural(_pluralRules_, _y_).
|
| 418 | + 1. If _xp_.[[FormattedString]] is _yp_.[[FormattedString]], then |
| 419 | + 1. Return _xp_.[[PluralCategory]]. |
417 | 420 | 1. Let _locale_ be _pluralRules_.[[Locale]].
|
418 | 421 | 1. Let _type_ be _pluralRules_.[[Type]].
|
419 |
| - 1. Return ! PluralRuleSelectRange(_locale_, _type_, _xp_, _yp_). |
| 422 | + 1. Return ! PluralRuleSelectRange(_locale_, _type_, _xp_.[[PluralCategory]], _yp_.[[PluralCategory]]). |
420 | 423 | </emu-alg>
|
421 | 424 | </emu-clause>
|
422 | 425 | </ins>
|
|
0 commit comments