I have suggestion about specification of the escape.

Michał Wadas michalwadas at gmail.com
Fri Nov 24 12:20:26 UTC 2017


It would break backwards compatibility, so it's absolute no-go.

Adding new function with such behaviour is unlikely, because escape is
defined in Annex B - and Annex B is effectively "deprecated but needs to be
there for backwards compatibility". "Use encodeURI
<https://developer.mozilla.org/pl/docs/Web/JavaScript/Referencje/Obiekty/encodeURI>
or encodeURIComponent
<https://developer.mozilla.org/pl/docs/Web/JavaScript/Referencje/Obiekty/encodeURIComponent>
instead" (MDN).

And I agree with T.J. Crowder - it's easily implementable in user land as
single-line arrow function and it's very specific use case.

On Fri, Nov 24, 2017 at 12:38 PM, Renan Bastos <renanbastos.tec at gmail.com>
wrote:

> Hey guys,
>
> I communicate that when we go use the escape to object JSON it don't
> escape correctly.
> So I think we should add this suggestion.
>
> const obj2 = {"name": "NodeJS", "version": "all"};
> console.log(escape(obj)); //%5Bobject%20Object%5D
>
> It needs to do this:
>
> const obj = {"name": "NodeJS", "version": "all"};
> console.log(escape(obj));
> //%7B%22name%22%3A%22NodeJS%22%2C%22version%22%3A%22all%22%7D
>
> As this we will reduce a step to escape.
>
> Wthat's you think about?
> I make myself available to do this.
>
> Now gotcha?
>
> 2017-11-24 7:52 GMT-02:00 Michael Rosefield <rosyatrandom at gmail.com>:
> > I think I can speak for the rest of us when I say: I really am not sure
> what
> > you're trying to say, here. Could you provide some examples?
> >
> > On Thu, 23 Nov 2017 at 15:44 Renan Bastos <renanbastos.tec at gmail.com>
> wrote:
> >>
> >>  Hello,
> >>
> >> Guys, I have thinked about one this title. So, I suggestion to we
> >> change the form of to escape one Object JSON.
> >> Today we have that to make this converting JSON to String, but I
> >> thought more interesting the function native did it.
> >> What you think about?
> >>
> >> Att,
> >> See ya.
> >> @renanbastos93
> >> www.renanbastos.com.br
> >> _______________________________________________
> >> es-discuss mailing list
> >> es-discuss at mozilla.org
> >> https://mail.mozilla.org/listinfo/es-discuss
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20171124/a301c0bd/attachment.html>


More information about the es-discuss mailing list