feat: split openExternal into sync and async#16176
Merged
codebytere merged 3 commits intomasterfrom Jan 15, 2019
Merged
Conversation
ckerr
approved these changes
Dec 21, 2018
4ae0b27 to
feeda28
Compare
7de2451 to
25ab6bd
Compare
b8fc5a5 to
b7df504
Compare
b7df504 to
451738f
Compare
zcbenz
approved these changes
Jan 15, 2019
| void OnOpenExternalFinished(const v8::Global<v8::Context>& context, | ||
| scoped_refptr<atom::util::Promise> promise, | ||
| const std::string& error) { | ||
| v8::Isolate* isolate = promise->isolate(); |
Member
There was a problem hiding this comment.
Should this be done in the promise helper to reduce this boilerplate being duplicated for all promises?
Contributor
There was a problem hiding this comment.
I agree moving the code to promise helper. But I would prefer doing it in a separate PR since it is a refactoring that modifies multiple files.
|
Release Notes Persisted
|
akisctx
pushed a commit
to akisctx/electron
that referenced
this pull request
Jan 22, 2019
* feat: split openExternal into sync and async * v8::Locker => mate::Locker * fix: enter js env when resolving promise
36 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
This API can't be promisified in the same way as previous apis, as its callback is optional.
This therefore follows Node's conventions and splits
shell.openExternal(url[, options, callback])intoshell.openExternalSync(url[, options])andshell.openExternal(url[, options]).shell.openExternal(url[, options])now returns a promise.This PR also adds specs for previously-untested
shell.openExternal()and also forshell.openExternalSync()./cc @miniak @ckerr
Checklist
npm testpassesRelease Notes
Notes: promisify
shell.openExternal()by splitting it into a sync and async method