Intent to Ship: String.prototype.isWellFormed and toWellFormed

160 views
Skip to first unread message

Shu-yu Guo

unread,
Jan 11, 2023, 8:16:50 PM1/11/23
to blink-dev

Contact emails

s...@chromium.org

Explainer

https://github.com/tc39/proposal-is-usv-string/blob/main/README.md

Specification

https://tc39.es/proposal-is-usv-string

Summary

Add two String.prototype methods for working with well-formed UTF-16 strings. A JavaScript string value is well-formed UTF-16 if it has no unpaired surrogate code points. By default, JavaScript strings may be ill-formed. - String.prototype.isWellFormed returns whether the receiver string is well-formed UTF-16. - String.prototype.toWellFormed returns a string that is identical to the receiver string, except all unpaired surrogate code points are replaced with U+FFFD (REPLACEMENT CHARACTER).



Blink component

Blink>JavaScript>Language

TAG review



TAG review status

Not applicable

Risks



Interoperability and Compatibility

No known compatibility risk. Though all additions to built-in prototypes such as String.prototype carry non-zero risk in light of polyfill libraries. No interoperability risk. This is a Stage 3 TC39 proposal.



Gecko: In development (https://bugzilla.mozilla.org/show_bug.cgi?id=1803523)

WebKit: In development (https://bugs.webkit.org/show_bug.cgi?id=248588)

Web developers: No signals

Other signals:

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?



Debuggability

Debuggable like other built-in String methods.

Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes

Is this feature fully tested by web-platform-tests?

In test262 

Flag name

--harmony-string-is-well-formed

Requires code in //chrome?

False

Tracking bug

https://bugs.chromium.org/p/v8/issues/detail?id=13557

Estimated milestones

DevTrial on desktop111
DevTrial on Android111


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).



Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5200195346759680

This intent message was generated by Chrome Platform Status.

Rick Byers

unread,
Jan 13, 2023, 12:32:50 PM1/13/23
to Shu-yu Guo, blink-dev
LGTM1

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAN-e9e_CJVsBrz%2Bc-Ujb-XEEi4GOjayd1cR77v9EMs5RoCNW_g%40mail.gmail.com.

Daniel Bratell

unread,
Jan 15, 2023, 4:09:44 AM1/15/23
to Rick Byers, Shu-yu Guo, blink-dev

Yoav Weiss

unread,
Jan 16, 2023, 5:47:11 AM1/16/23
to Daniel Bratell, Rick Byers, Shu-yu Guo, blink-dev
Reply all
Reply to author
Forward
0 new messages