Skip to content

Optimisation bug with subtracting negative numbers #293

Open
@stevehobbsdev

Description

@stevehobbsdev

I just came across this scenario with a piece of code of ours. The following (valid) C# code:

int number = somevar - -10; // legitimately subtracting a negative number

.. becomes this, when optimised and minified in Javascript:

var $a=somevar--10;

.. which is invalid, both in C# and Javascript. The code works when using the debug script, but it doesn't when minified, causing a discrepency between the two scripts. I think this is maybe more of an issue with the minifier being used thought, just thought I'd make you aware.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions