Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4076

update JS polyfills for String prototype functions

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 8.5.2.1
    • Fix Version/s: 8.6.1
    • Component/s: Browser Issue
    • Security Level: Jimmy

      Description

      the Javascript String.prototype functions (startsWith/endsWith/trim) have been standardized and are more or less supported by modern browsers.

      ZK's current polyfills in js.js are 9 years old and don't fully implement the JS spec potentially breaking 3rd party libraries depending on the standards.

      https://github.com/zkoss/zk/blob/v8.5.2.1/zk/src/archive/web/js/zk/js.js#L14-L22

      compared to:

      https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
      https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith
      https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim

      We should update the polyfills using the recommendations from MDN and only apply them in older browsers depending on availability.

        Attachments

          Activity

            People

            Assignee:
            rudyhuang rudyhuang
            Reporter:
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Time Spent - 3 hours Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - 3 hours Remaining Estimate - 1 hour
                3h