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

Fix issue #8232. Changed the ExecuteJavaScript extension method to corre... #293

Closed
wants to merge 1 commit into from

Conversation

chrisblock
Copy link
Contributor

...ctly detect if the script result is convertible to the generic type.

…rrectly detect if the script result is convertible to the generic type.
@jimevans
Copy link
Member

Two things. First, you need to indicate whether or not you've signed the CLA.

Second, using the is operator implies a hidden cast to the specified type, which is a perf hit and should be flagged by static analysis (FxCop). Two other possible approaches might be using the as operator with a null check, which may be problematic with generics; or adding type constraints to the type parameter.

@chrisblock
Copy link
Contributor Author

I have signed the CLA. Sorry about that. Is there some other way you need me to indicate it than by merely saying so here?

Secondly, as to the is operator, I would rather change it to typeof (T).IsInstanceOfType(result) == false (which is what I had it as before ReSharper suggested otherwise) than the as cast and check for null, which, as you suspect, would cause issues when T is a value type.

Should I just commit that change, or should I revert, re-change and commit and then re-issue the pull request (to keep the selenium commit log clean)?

@chrisblock
Copy link
Contributor Author

I will re-issue the pull request after having made the modifications.

@chrisblock chrisblock closed this Dec 23, 2014
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.

2 participants