Extends expression performs differently on Edge

# Gareth Heyes (8 years ago)

I hope you don't mind me posting this stuff. I enjoy finding these quirks. This one alerts on Edge but not on other browsers.

1,class extends[]/alert(1){} // alerts on Edge, syntax error on other browsers

# Brian Terlson (8 years ago)

I certainly do not mind! I am happy to file bugs but if you like, you can file these at microsoft/ChakraCore!

I’ve filed this one here: Microsoft/ChakraCore#3040

From: es-discuss [mailto:es-discuss-bounces at mozilla.org] On Behalf Of Gareth Heyes Sent: Wednesday, May 24, 2017 1:24 AM To: es-discuss at mozilla.org Subject: Extends expression performs differently on Edge

Hi all

I hope you don't mind me posting this stuff. I enjoy finding these quirks. This one alerts on Edge but not on other browsers.

1,class extends[]/alert(1){} // alerts on Edge, syntax error on other browsers

# Gareth Heyes (8 years ago)

Ok cool I'll report it there. I have another one: ັັັalert(ັັັ'LOL Edge'ັັັ)ັັັ

# Gareth Heyes (7 years ago)
class y{}class z{}
class x extends y, z{}/alert(1)/+alert(2)

Edge seems to allow non-standard syntax here. I guess to allow you to extend multiple classes but as far as I'm aware this is non-standard syntax. The code above calls alert(2), if you change it to a class expression both alerts are called. It's a syntax error on other browsers.

# Alexander Jones (7 years ago)

y, z is comma operator, no?

# Gareth Heyes (7 years ago)

On 26 May 2017 at 10:14, Alexander Jones <alex at weej.com> wrote:

y, z is comma operator, no?

Then z{} should be a syntax error. Look Edge is insane:

class y{}class z{}1,class x extends y,/a/,x=>{},class z extends alert(1),

class abc{}{}{}/alert(2)/+alert(3)