You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Minifier not generating the script when BigInt() method is used with a higher values.
Steps to recreate
Adding a sample code. The intention of this code is to check if the given string is well within the C# Int64 range.
let TryParseLong = function (str, defaultValue) {
var retValue = defaultValue;
if (str !== null) {
if (str.length > 0 && str.length <= 19) {
if (!isNaN(str)) {
if (BigInt(str) < BigInt("9223372036854775807")) { //Int64.MaxValue is "9223372036854775807"
retValue = BigInt(str);
}
console.log(retValue);
}
}
}
return retValue;
}
Current behavior
The minifier generates the minification file
However the BigInt("9223372036854775807") gets generated as -9223372036854775808n
The minified code generated on the machine is
let TryParseLong=function(n,t){var i=t;return n!==null&&n.length>0&&n.length<=19&&(isNaN(n)||(BigInt(n)<-9223372036854775808n&&(i=BigInt(n)),console.log(i))),i},a=123456,b=TryParseLong(a,-1);alert(b);
Expected behavior
Ideally it should stay as
9223372036854775808n
let TryParseLong=function(n,t){var i=t;return n!==null&&n.length>0&&n.length<=19&&(isNaN(n)||(BigInt(n)<9223372036854775808n&&(i=BigInt(n)),console.log(i))),i},a=123456,b=TryParseLong(a,-1);alert(b);
The text was updated successfully, but these errors were encountered:
sapnc
changed the title
Minification not generating when BigInt is involved
Minification not generating the file correctly when BigInt is involved
Mar 21, 2024
This is caused by targeting .Net 3.5 in NUglify; if you use BigInt("9007199254740991") for your comparison, it works correctly; if you aren't expecting numbers to be larger than that.
Installed product versions
Description
The Minifier not generating the script when BigInt() method is used with a higher values.
Steps to recreate
Adding a sample code. The intention of this code is to check if the given string is well within the C# Int64 range.
let TryParseLong = function (str, defaultValue) {
var retValue = defaultValue;
if (str !== null) {
if (str.length > 0 && str.length <= 19) {
if (!isNaN(str)) {
if (BigInt(str) < BigInt("9223372036854775807")) { //Int64.MaxValue is "9223372036854775807"
retValue = BigInt(str);
}
console.log(retValue);
}
}
}
}
Current behavior
The minifier generates the minification file
However the BigInt("9223372036854775807") gets generated as -9223372036854775808n
The minified code generated on the machine is
let TryParseLong=function(n,t){var i=t;return n!==null&&n.length>0&&n.length<=19&&(isNaN(n)||(BigInt(n)<-9223372036854775808n&&(i=BigInt(n)),console.log(i))),i},a=123456,b=TryParseLong(a,-1);alert(b);
Expected behavior
Ideally it should stay as
9223372036854775808n
let TryParseLong=function(n,t){var i=t;return n!==null&&n.length>0&&n.length<=19&&(isNaN(n)||(BigInt(n)<9223372036854775808n&&(i=BigInt(n)),console.log(i))),i},a=123456,b=TryParseLong(a,-1);alert(b);
The text was updated successfully, but these errors were encountered: