My Assert in Flash

That's bit silly, i know, but i was SO missing my assert in Flash...After many years of using it in c++ and c#, i can't live without it !
So, just create a file "assert.as" in flexbuilder :
// ActionScript file
package
{
function assert(expr:Boolean=false,msg:string=""):void
{
if (expr)
return;
throw new Error(msg);
}
}

That's all ! All exception not catched make the debuguer launch if u program with flexbuilder3 as me !

Aucun commentaire: