es-shims/es7-shim

mongolian vowel separator

Opened this issue · 1 comments

There was a backwards-incompatible change in ES7 corresponding to whitespace, as the Unicode version pin was removed:

https://www.ecma-international.org/ecma-262/6.0/#sec-white-space

ECMAScript implementations must recognize as WhiteSpace code points listed in the “Separator, space” (Zs) category by Unicode 5.1.

https://www.ecma-international.org/ecma-262/7.0/#sec-white-space

ECMAScript implementations must recognize as WhiteSpace code points listed in the “Separator, space” (Zs) category.

The MONGOLIAN VOWEL SEPARATOR U+180E used to be in Zs but was moved to Cf in Unicode 6.3.0. ES7 mandates Unicode 8.0.0 or higher. As a result, whitespace-sensitive methods will behave differently.

For example, consider "\u180e".trim().length. An ES6-compatible browser like Safari 11 will remove the character, yielding a length of 0. However, an ES7-compatible engine should not remove the character, yielding a length of 1.

String#trim and other methods that lean on whitespace are affected.

tc39/ecma262#1698 corrects this omission in the spec's Annex E.