Opened 13 years ago

Closed 11 years ago

Last modified 11 years ago

#1768 closed defect (fixed)

ShrinkSafe fails on 'var' lists

Reported by: leeatkinsonlincs@… Owned by: alex
Priority: high Milestone: 1.2
Component: ShrinkSafe Version: 0.4
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by dylan)

Hi

If you write code such as:

var foo, bar;

The second and subsequent variables in the list are not 'shrinked'.

If you write: var foo; var bar;

It then works correctly.

Regards, Lee

Attachments (2)

pre-test.js (706 bytes) - added by dante 11 years ago.
test case before ss
post-test.js (558 bytes) - added by dante 11 years ago.
result of buld 8-23 svn

Download all attachments as: .zip

Change History (13)

comment:1 Changed 12 years ago by dylan

Component: GeneralBuildTools
Milestone: 0.9
Owner: changed from anonymous to alex

comment:2 Changed 12 years ago by Adam Peller

Component: BuildToolsShrinkSafe

comment:3 Changed 11 years ago by dylan

Milestone: 1.11.2

moving shrinksafe bugs to 1.2

comment:4 Changed 11 years ago by dylan

Description: modified (diff)
Milestone: 1.2future

moving shrinksafe bugs to future... help wanted.

comment:5 Changed 11 years ago by Adam Peller

Is it my imagination or does this work now?

Changed 11 years ago by dante

Attachment: pre-test.js added

test case before ss

Changed 11 years ago by dante

Attachment: post-test.js added

result of buld 8-23 svn

comment:6 Changed 11 years ago by dante

no telling when this happened, but viola ... at least the test wrapped within a self executing anon function works

comment:7 Changed 11 years ago by dante

Milestone: future1.2
Resolution: worksforme
Status: newclosed

I tested functions inside of a dojo.declare() member functions, and they work there too. marking as such.

comment:8 Changed 11 years ago by dante

okay. this works in the simple test case, but fails somewhere I was explicitly expect it to. I tested uploading dojox/fx/_base.js to shrinksafe.dojotoolkit.org, which failed in obfuscating the "const" variables I used to to limit string repetition. it fails via shrinksafe.dtk.org, but worked properly running a build from trunk. so I'm confused, but leaving this closed.

comment:9 Changed 11 years ago by dante

Resolution: worksforme
Status: closedreopened

okay -- officially:

5 revisions of custom_rhino seems to have fixed this. The above weirdness was because http://shrinksafe.dojotoolkit.org was using a much older version. thanks peller, dmachi - the public facing shrinksafe has been updated, so non-Dojo users can benefit from this, too.

now that this is a fact, do we implement a style guideline on the use of var lists? Knowing this ticket existed, I've always done them individually

var oneLongOne = "a";
var anotherLongOne = "b";

But we save in the long run by using the perfectly valid

var one = "a", two = "b";

by n*3 bytes. worth considering?

... this is in fact fixed in 1.2

comment:10 Changed 11 years ago by dante

Resolution: fixed
Status: reopenedclosed

comment:11 in reply to:  9 Changed 11 years ago by James Burke

Replying to dante:

now that this is a fact, do we implement a style guideline on the use of var lists? Knowing this ticket existed, I've always done them individually

I still like seeing them separate, but seems like we could tolerate both types. I think the var difference is negligible once gzipping kicks in. That said, the var list is used in some places already. Today I saw one in dojo._base.connect getDispatcher function.

Note: See TracTickets for help on using tickets.