Loading ...
Sorry, an error occurred while loading the content.

Can escape() and unescape() generate warnings?

Expand Messages
  • kevin_hakanson
    First, thanks for making updates to JSLint based on this groups comments. It s easiest just to quote another source for this request: The escape and unescape
    Message 1 of 1 , Jul 8 7:19 PM
    • 0 Attachment
      First, thanks for making updates to JSLint based on this groups comments.

      It's easiest just to quote another source for this request:

      "The escape and unescape functions do not work properly for non-ASCII
      characters and have been deprecated. In JavaScript 1.5 and later, use
      encodeURI, decodeURI, encodeURIComponent, and decodeURIComponent."
      http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Predefined_Functions:escape_and_unescape_Functions

      I still run into developers that use escape() and I have to manually
      correct them. Just for completeness I took I look at the Ecma spec.
      http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf

      In "Annex B: Compatibility", there are additional items (other than
      escape(string) and unescape(string) ), that had been removed.

      String.prototype.substr(start, length)
      Date.prototype.getYear()
      Date.prototype.setYear(year)
      Date.prototype.toGMTString()

      Maybe JSLint could add a emca3 option that generates a warning for any
      of this six items?
    Your message has been successfully submitted and would be delivered to recipients shortly.