909Re: [jslint] Re: escape()
- Sep 12, 2009On Fri, Sep 11, 2009 at 8:37 PM, douglascrockford <douglas@...>wrote:
> --- In email@example.com, Dominic Mitchell <dom@...> wrote:Because it's quite likely that people would simply add /*global escape */
> > Would it be possible to get JSLint to warn if you call the escape()
> > function? The bad behaviour of this function has caused me problems this
> > morning. It encodes characters as %uXXXX instead of UTF-8 bytes. Plus,
> > doesn't handle plus characters. I think that most instances of this
> > function should be replaced by encodeURIComponent().
> Depending on the options you choose, you current get either
> Implied global: escape
> Problem at line 1 character 1: 'escape' is not defined.
> Why isn't that sufficient?
and carry on. Whereas a specific warning that escape() should be replaced
by encodeURIComponent() (at least, in a browser environment) would be a lot
[Non-text portions of this message have been removed]
- << Previous post in topic Next post in topic >>