[webkit-reviews] review granted: [Bug 214223] Intl.Locale maximize, minimize should return Intl.Locale instead of String : [Attachment 404078] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jul 11 18:34:25 PDT 2020


Ross Kirsling <ross.kirsling at sony.com> has granted Yusuke Suzuki
<ysuzuki at apple.com>'s request for review:
Bug 214223: Intl.Locale maximize, minimize should return Intl.Locale instead of
String
https://bugs.webkit.org/show_bug.cgi?id=214223

Attachment 404078: Patch

https://bugs.webkit.org/attachment.cgi?id=404078&action=review




--- Comment #5 from Ross Kirsling <ross.kirsling at sony.com> ---
Comment on attachment 404078
  --> https://bugs.webkit.org/attachment.cgi?id=404078
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=404078&action=review

r=me, thanks!

> Source/JavaScriptCore/runtime/IntlLocale.h:56
> -    const String& maximize();
> -    const String& minimize();
> +    const String& maximal();
> +    const String& minimal();

I'm not sure that we need to change the method names here just because we're
changing the field names -- toString currently returns m_fullString, say.

(Doesn't matter too much either way though since this is internal.)

> Source/JavaScriptCore/runtime/IntlLocalePrototype.cpp:141
> +    const String& fullString = locale->toString();
> +    RELEASE_AND_RETURN(scope, JSValue::encode(fullString.isEmpty() ?
jsUndefined() : jsNontrivialString(vm, fullString)));

Hmm, my reasoning for not empty-checking these three is that we should have
failed to construct an Intl.Locale at all if these can't be produced -- i.e. it
would be ICU disagreeing *with itself* if these fail.

> JSTests/ChangeLog:9
> +	   * stress/intl-locale-maximize-minimize.js: Added.

I think we should just add to the relevant part of intl-locale.js, since this
is a mistake in the basic behavior of these two methods.


More information about the webkit-reviews mailing list