Skip to content

Commit

Permalink
Use MakeCallback instead of Call (#20)
Browse files Browse the repository at this point in the history
* Use MakeCallback instead of Call

* Fix windows watchman install in CI
  • Loading branch information
devongovett authored Nov 6, 2019
1 parent 609812e commit f20d6d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions azure-pipelines-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ jobs:
- ${{ if eq(parameters.name, 'Windows') }}:
- script: |
curl -sSf -L -o watchman.zip https://ci.appveyor.com/api/buildjobs/vkp4mmk1cri9jsel/artifacts/watchman.zip
curl -sSf -L -o watchman.zip https://github.com/facebook/watchman/suites/296618337/artifacts/249606
displayName: Download Watchman
- task: ExtractFiles@1
inputs:
archiveFilePatterns: 'watchman.zip'
destinationFolder: $(Agent.HomeDirectory)\watchman
destinationFolder: $(Agent.HomeDirectory)
cleanDestinationFolder: false
displayName: Extract Watchman
- script: |
set PATH=%PATH%;$(Agent.HomeDirectory)\watchman
set PATH=%PATH%;$(Agent.HomeDirectory)\watchman\windows\bin
echo "##vso[task.setvariable variable=PATH]%PATH%"
watchman -v
displayName: Install Watchman
Expand Down
2 changes: 1 addition & 1 deletion src/Watcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void Watcher::fireCallbacks(uv_async_t *handle) {
HandleScope scope(it->Env());
auto err = watcher->mError.size() > 0 ? Error::New(it->Env(), watcher->mError).Value() : it->Env().Null();
auto events = watcher->mCallbackEvents.toJS(it->Env());
it->Call(std::initializer_list<napi_value>{err, events});
it->MakeCallback(it->Env().Global(), std::initializer_list<napi_value>{err, events});

// If the iterator was changed, then the callback trigged an unwatch.
// The iterator will have been set to the next valid callback.
Expand Down

0 comments on commit f20d6d5

Please sign in to comment.