-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Use Begin/End pattern to not break .Net 4 compatibility. #491
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,12 +51,11 @@ public void SetOperationContext(OperationContext operationContext) | |
| public Task<JavascriptResponse> EvaluateScriptAsync(int browserId, long frameId, string script, TimeSpan? timeout) | ||
| { | ||
| var operationContextTask = operationContextTaskCompletionSource.Task; | ||
|
|
||
| return operationContextTask.ContinueWith(t => | ||
| { | ||
| var context = t.Result; | ||
| var renderProcess = context.GetCallbackChannel<IRenderProcess>(); | ||
| return renderProcess.EvaluateScriptAsync(browserId, frameId, script, timeout); | ||
| return Task.Factory.FromAsync<JavascriptResponse>(renderProcess.BeginEvaluateScriptAsync(browserId, frameId, script, timeout, null, null), renderProcess.EndEvaluateScriptAsync); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are needed yes. Omitting them gives a runtime exception.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok cool, thx |
||
| }).Unwrap(); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ifblocks need to have braces, keeps the style consistent.