as3hx
as3hx copied to clipboard
Brace followed by comment conversion bug
If a brace is followed by a comment on the next line, the brace is removed and added the end of the comment and now the code is missing a brace and is no longer compilable.
as3 code for example:
if(this._explicitWidth !== this._explicitWidth && //isNaN
(this.actualWidth > value || this.actualWidth == oldValue))
{
//only invalidate if this change might affect the width
this.invalidate(INVALIDATION_FLAG_SIZE);
}
expected result
if(this._explicitWidth != this._explicitWidth && //isNaN
(this.actualWidth > value || this.actualWidth == oldValue))
{
//only invalidate if this change might affect the width
this.invalidate(INVALIDATION_FLAG_SIZE);
}
actual result
if (this._explicitWidth != this._explicitWidth && //isNaN
(this.actualWidth > value || this.actualWidth == oldValue))
//only invalidate if this change might affect the width{
this.invalidate(INVALIDATION_FLAG_SIZE);
}
Same issue on my side.
Source:
if (expressionA)
{
// comment
expressionB;
}
Result:
if (expressionA)
// comment{
expressionB;
}
Expected result:
if (expressionA)
{
// comment
expressionB;
}
I'm also interested in a proper fix.
In the meantime I did a quick workaround here: https://github.com/firefalcom/as3hx/commit/84b93d5aa53191bab9a6a411699bd468dc913b98