diff --git a/YantraJS.Core/Core/JSValue.cs b/YantraJS.Core/Core/JSValue.cs index ff0746d7..e297b5ca 100644 --- a/YantraJS.Core/Core/JSValue.cs +++ b/YantraJS.Core/Core/JSValue.cs @@ -122,7 +122,7 @@ public virtual int Length { public abstract JSValue TypeOf(); - public virtual int IntValue => (int)(uint)this.DoubleValue; + public virtual int IntValue => (int)((long)this.DoubleValue << 32) >> 32; /// /// Integer value restricts value within int.MaxValue and diff --git a/YantraJS.Core/Core/Number/JSNumber.cs b/YantraJS.Core/Core/Number/JSNumber.cs index 30001be0..cd41e373 100644 --- a/YantraJS.Core/Core/Number/JSNumber.cs +++ b/YantraJS.Core/Core/Number/JSNumber.cs @@ -118,7 +118,7 @@ public JSNumber(double value) : base() this.value = value; } - public override int IntValue => (int)(uint)value; + public override int IntValue => (int)(((long)value << 32) >> 32); public override double DoubleValue => value; diff --git a/YantraJS/YantraJS.csproj b/YantraJS/YantraJS.csproj index 6588f1d3..a32d4242 100644 --- a/YantraJS/YantraJS.csproj +++ b/YantraJS/YantraJS.csproj @@ -2,7 +2,7 @@ Exe - net6 + net9.0 YantraJS YantraJS yantra,yantrajs,javascript,c#,standard,core,framework,.net