Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dotnet][bidi] Underlying local/remote script number as double #15301

Merged
merged 2 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading