Skip to main content
April 2, 2009
Question

ActionScript compiler warnings

  • April 2, 2009
  • 1 reply
  • 690 views
Few days ago I found myself debugging the code which seems perfectly OK but doesnt work as expected. After some time I realized that my mistake was trivial:
If (some complex condition);
{
Do something.
}

Although this is perfectly correct ActionScript statement I think it should cause compiler warning.

I have reported a bug and submitted a patch adding warnings in following situations:

if (value == 1); //this should cause warning
{
trace("some code");
}

while(value > 0); //this should cause warning
{
trace("some code");
}

for (var i:int = 0; i < 10 ; i++ ); //this should cause warning
{
trace("some code");
}

https://bugs.adobe.com/jira/browse/ASC-3703

What is interesting 3 bugs in the framework can be found and instantly fixed after enabling these warnings.

Do you know any other common trivial mistakes which should cause compiler warnings?

Cheers,
Iwo Banas
This topic has been closed for replies.

1 reply

matt_chotin
Inspiring
April 2, 2009
Hey Iwo,



Have you filed/fixed those framework bugs?  Compiler team will take a look at the ASC patch though it may not be immediately.



Matt





On 4/2/09 9:34 AM, "Iwo Banas" < member@adobeforums.com> wrote:



A new discussion was started by Iwo Banas in



Developers --

  ActionScript compiler warnings



Few days ago I found myself debugging the code which seems perfectly OK but doesn’t work as expected. After some time I realized that my mistake was trivial:

If (some complex condition);

{

Do something.

}



Although this is perfectly correct ActionScript statement I think it should cause compiler warning.



I have reported a bug and submitted a patch adding warnings in following situations:  



if (value == 1); //this should cause warning

{

trace("some code");

}



while(value > 0); //this should cause warning

{

trace("some code");

}



for (var i:int = 0; i < 10 ; i++ ); //this should cause warning  {  trace("some code");  }



https://bugs.adobe.com/jira/browse/ASC-3703



What is interesting 3 bugs in the framework can be found and instantly fixed after enabling these warnings.



Do you know any other common trivial mistakes which should cause compiler warnings?  



Cheers,

Iwo Banas




View/reply at ActionScript compiler warnings < http://www.adobeforums.com/webx?13@@.59b87b87>

Replies by email are OK.

Use the unsubscribe < http://www.adobeforums.com/webx?280@@.59b87b87!folder=.3c060fa3>  form to cancel your email subscription.