kenchris / urlpattern-polyfill

URLPattern polyfill
https://www.npmjs.com/package/urlpattern-polyfill
MIT License
268 stars 31 forks source link

Improve empty string port support. #14

Closed wanderview closed 3 years ago

wanderview commented 3 years ago

This commit makes the following changes:

  1. It makes applyInit() distinguish between empty string and undefined values. Its important that we actually apply empty string values and not treat them the same as missing values.

  2. It initializes test() and exec() component values to the empty string. This is consistent with the native implementation.

  3. Fixes a bug in the test driver where empty string was not distinguished from undefined.

  4. Moves the default port canonicalization into canonicalizePort().