Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

String.prototype.normalize always returns the original string #8957

Closed
@devongovett

Description

@devongovett

Not sure if this is a v8 issue, but it works in Chrome so I thought I'd report here. String.prototype.normalize seems to always return the original string, rather than actually normalizing it. Tested in node v0.11.14. You can run this to confirm (run in node v0.11.14 and Chrome 34+):

String.fromCharCode(7690).normalize('NFD').length // should be 2, returns 1

This is the patch adding support for the method in v8.

Currently, polyfills won't be enabled unless they also test for a correct implementation, breaking code that previously worked under versions of node without any implementation of String.prototype.normalize at all.

Perhaps something with the way ICU is built in node could cause this? I noticed one mention of normalization in #7719. If ICU is not going to be built/linked by default with node, then String.prototype.normalize should also be disabled by default. IMHO it needs to be supported eventually since the method is part of the language, but if fixing the issue is a big deal, disabling it for now would be a fine option I think.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions