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

We don't need no dynamics #823

Merged
merged 6 commits into from
Dec 31, 2018
Merged

We don't need no dynamics #823

merged 6 commits into from
Dec 31, 2018

Conversation

kblok
Copy link
Member

@kblok kblok commented Dec 27, 2018

closes #97

@kblok kblok requested a review from Meir017 December 28, 2018 12:03
@@ -173,8 +174,8 @@ internal async Task<JSHandle> EvaluateFunctionHandleAsync(string script, params
}
}

internal JSHandle CreateJSHandle(dynamic remoteObject)
=> (remoteObject.subtype == "node" && Frame != null)
internal JSHandle CreateJSHandle(JToken remoteObject)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to create a class for this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the shape of the Token (adding this for reference)

image
image
image
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair enough

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will implement a class @Meir017 the shape will be a composition of that ;)

{
internal class EvaluateHandleResponse
{
public JToken ExceptionDetails { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be a class?

@@ -1865,7 +1866,7 @@ private async Task<object> ExecuteBinding(BindingCalledResponse e)
if (taskResult.GetType().IsGenericType)
{
// the task is already awaited and therefore the call to property Result will not deadlock
result = ((dynamic)taskResult).Result;
result = taskResult.GetType().GetProperty(taskResultPropertyName).GetValue(taskResult);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the old way was weird but this also feels a bit odd, is there a clean way to do this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I open to new ideas 😂

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created an issue for this #824

{
if (e.Entry.Args != null)
{
foreach (var arg in e.Entry?.Args)
{
RemoteObjectHelper.ReleaseObject(Client, arg, _logger);
await RemoteObjectHelper.ReleaseObjectAsync(Client, arg, _logger);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this missing .ConfigureAwait(false) ?

@kblok
Copy link
Member Author

kblok commented Dec 28, 2018

Ready to review again @Meir017

@kblok kblok merged commit a3f809f into master Dec 31, 2018
@kblok kblok deleted the v1.12/remove-more-dynamics branch December 31, 2018 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use strongly typed objects instead of dynamic everywhere
2 participants