Skip to content

Commit

Permalink
[dotnet][bidi] Underlying local/remote script number as double (#15301)
Browse files Browse the repository at this point in the history
  • Loading branch information
nvborisenko authored Feb 19, 2025
1 parent 21d8e10 commit 029ee43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dotnet/src/webdriver/BiDi/Modules/Script/LocalValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ public abstract record PrimitiveProtocolLocalValue : LocalValue

}

public record Number(long Value) : PrimitiveProtocolLocalValue
public record Number(double Value) : PrimitiveProtocolLocalValue
{
public static explicit operator Number(int n) => new Number(n);
public static explicit operator Number(double n) => new Number(n);
}

public record String(string Value) : PrimitiveProtocolLocalValue;
Expand Down
4 changes: 2 additions & 2 deletions dotnet/src/webdriver/BiDi/Modules/Script/RemoteValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace OpenQA.Selenium.BiDi.Modules.Script;
public abstract record RemoteValue
{
public static implicit operator int(RemoteValue remoteValue) => (int)((Number)remoteValue).Value;
public static implicit operator long(RemoteValue remoteValue) => ((Number)remoteValue).Value;
public static implicit operator long(RemoteValue remoteValue) => (long)((Number)remoteValue).Value;
public static implicit operator string(RemoteValue remoteValue)
{
return remoteValue switch
Expand Down Expand Up @@ -93,7 +93,7 @@ public static implicit operator string(RemoteValue remoteValue)
throw new BiDiException("Cannot convert .....");
}

public record Number(long Value) : PrimitiveProtocolRemoteValue;
public record Number(double Value) : PrimitiveProtocolRemoteValue;

public record Boolean(bool Value) : PrimitiveProtocolRemoteValue;

Expand Down

0 comments on commit 029ee43

Please # to comment.