Ticket #2528116 (new defect)

Reporter


Mathias Bynens
Opened: 08/1/11
Last modified: 04/16/12
Status: new
Type: defect

Owner


Reid Burke
Target Release:
Priority:
Summary: Reserved words are still valid property names
Description:

YUI Compressor will error and fail to compress something like:

var foo = {};
{}.default;

Even though there’s nothing wrong with it as per ES5.

See http://_Sgithub.com/rwldrn/idiomatic.js/issues/5#issuecomment-1664338 for more information.

Type: defect Observed in Version: 2.4.6
Component: YUICompressor Severity: S2 (high)
Assigned To: Reid Burke Target Release:
Location: Priority:
Tags: Relates To:
Browsers: N/A
URL:
Test Information:

Try to access a property which has a reserved word as its name (note that this is valid JS), e.g.

var foo = {};
foo.default;

…or…

({}).default;

YUI Compressor will error when trying to compress this.

Change History

Mathias Bynens

Posted: 08/1/11

Okay, so the GitHub link with more info got messed up somehow, here it is again: http://mths.be/bck

Mathias Bynens

Posted: 08/1/11

Also, I made a typo in the description field. I meant:


var foo = {};
foo.default;

Not

{}.default
, of course.

Mathias Bynens

Posted: 04/16/12