Arrow function followed by divide or syntax error?
Gareth Heyes
gareth.heyes at portswigger.net
Wed May 24 06:57:16 UTC 2017
On 23 May 2017 at 17:01, Claude Pache <claude.pache at gmail.com> wrote:
> This is not specific to the divide operator. If you try:
>
> ```js
> x => {} * alert(1)
> ```
>
>
Yeah of course I mentioned divide because it's more interesting because it
can lead to js sandbox escapes.
> you'll get a SyntaxError in all browsers but Edge, which interprets it as
> `(x => {}) * alert(1)`.
>
> Given how confusing that expression is, I think that the SyntaxError is
> the right choice.
Well it is a function expression. So IMO Edge is right. It's equivalent to:
x=function(){} * alert(1)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170524/32aeb0de/attachment-0001.html>
More information about the es-discuss
mailing list