helloadhavan/github_issues huggingface dataset:
Repository: nodejs/node
Pull request: doc: add history entry for import assertion removal

We document when we started supporting them, not we stopped. This PR fixes that.

Refs: https://github.com/nodejs/node/pull/52104
<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->


Changed files:
filename: doc/api/esm.md
patch: @@ -12,6 +12,9 @@ changes:
     - v18.20.5
     pr-url: https://github.com/nodejs/node/pull/55333
     description: Import attributes are no longer experimental.
+  - version: v22.0.0
+    pr-url: https://github.com/nodejs/node/pull/52104
+    description: Drop support for import assertions.
   - version:
     - v21.0.0
     - v20.10.0
Repository: ggml-org/llama.cpp
Pull request: sycl: update documentation to use -no-cnv

Update SYCL documentation to use `-no-cnv` for the example `llama-cli` commands. Related PR https://github.com/ggml-org/llama.cpp/pull/11214.

Changed files:
filename: docs/backend/SYCL.md
patch: @@ -425,13 +425,13 @@ Examples:
 - Use device 0:
 
 ```sh
-ZES_ENABLE_SYSMAN=1 ./build/bin/llama-cli -m models/llama-2-7b.Q4_0.gguf -p "Building a website can be done in 10 simple steps:" -n 400 -e -ngl 33 -sm none -mg 0
+ZES_ENABLE_SYSMAN=1 ./build/bin/llama-cli -no-cnv -m models/llama-2-7b.Q4_0.gguf -p "Building a website can be done in 10 simple steps:" -n 400 -e -ngl 33 -sm none -mg 0
 ```
 
 - Use multiple devices:
 
 ```sh
-ZES_ENABLE_SYSMAN=1 ./build/bin/llama-cli -m models/llama-2-7b.Q4_0.gguf -p "Building a website can be done in 10 simple steps:" -n 400 -e -ngl 33 -sm layer
+ZES_ENABLE_SYSMAN=1 ./build/bin/llama-cli -no-cnv -m models/llama-2-7b.Q4_0.gguf -p "Building a website can be done in 10 simple steps:" -n 400 -e -ngl 33 -sm layer
 ```
 
 *Notes:*
@@ -697,13 +697,13 @@ Examples:
 - Use device 0:
 
 ```
-build\bin\llama-cli.exe -m models\llama-2-7b.Q4_0.gguf -p "Building a website can be done in 10 simple steps:\nStep 1:" -n 400 -e -ngl 33 -s 0 -sm none -mg 0
+build\bin\llama-cli.exe -no-cnv -m models\llama-2-7b.Q4_0.gguf -p "Building a website can be done in 10 simple steps:\nStep 1:" -n 400 -e -ngl 33 -s 0 -sm none -mg 0
 ```
 
 - Use multiple devices:
 
 ```
-build\bin\llama-cli.exe -m models\llama-2-7b.Q4_0.gguf -p "Building a website can be done in 10 simple steps:\nStep 1:" -n 400 -e -ngl 33 -s 0 -sm layer
+build\bin\llama-cli.exe -no-cnv -m models\llama-2-7b.Q4_0.gguf -p "Building a website can be done in 10 simple steps:\nStep 1:" -n 400 -e -ngl 33 -s 0 -sm layer
 ```
Repository: huggingface/transformers
Pull request: Fix static cache export

# What does this PR do?

Fixed a test regression due to old arg deprecation.

```
RUN_SLOW=1 pytest tests/utils/test_cache_utils.py -k test_static_cache_exportability
```


## Before submitting
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
      Pull Request section?
- [x] Did you write any new necessary tests?


## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@ArthurZucker @qubvel

Changed files:
filename: src/transformers/integrations/executorch.py
patch: @@ -69,7 +69,7 @@ def __init__(self, model: PreTrainedModel):
         self.model = model
         self.static_cache = StaticCache(
             config=self.model.config,
-            batch_size=self.model.generation_config.cache_config.batch_size,
+            max_batch_size=self.model.generation_config.cache_config.batch_size,
             max_cache_len=self.model.generation_config.cache_config.max_cache_len,
             device=self.model.generation_config.cache_config.device,
             dtype=self.model.dtype,
Repository: electron/electron
Pull request: fix: system-context-menu with frameless BrowserWindows

Backport of #43243

See that PR for details.


Notes: Fixed an issue where `system-context-menu` was not triggered as expected on Windows when using a frameless BrowserWindow. 

Changed files:
filename: shell/browser/native_window_views_win.cc
patch: @@ -289,6 +289,15 @@ bool NativeWindowViews::PreHandleMSG(UINT message,
 
       return false;
     }
+    case WM_RBUTTONUP: {
+      if (!has_frame()) {
+        bool prevent_default = false;
+        NotifyWindowSystemContextMenu(GET_X_LPARAM(l_param),
+                                      GET_Y_LPARAM(l_param), &prevent_default);
+        return prevent_default;
+      }
+      return false;
+    }
     case WM_GETMINMAXINFO: {
       WINDOWPLACEMENT wp;
       wp.length = sizeof(WINDOWPLACEMENT);
Repository: facebook/react
Pull request: Packages/React/src/ReactLazy ---> changing -1 to unintialized

-1 here seems odd as it breaks code structure , hence added uninitialized.

Changed files:
filename: packages/react/src/ReactLazy.js
patch: @@ -123,7 +123,7 @@ export function lazy<T>(
 ): LazyComponent<T, Payload<T>> {
   const payload: Payload<T> = {
     // We use these fields to store the result.
-    _status: -1,
+    _status: Uninitialized,
     _result: ctor,
   };
Repository: nodejs/node
Pull request: test_runner: error on mocking an already mocked date

Fixes #55849

Previously, the properties from the global `Date`, including the not-writable `isMock` and `[kMock]` values, would be copied if the global `Date` was already mocked. This became an issue because the mock setup would attempt overwrite these properties.

Now, `ERR_INVALID_STATE` is thrown, as `Date is already being mocked!`.

## Example

```js
import { test } from 'node:test'

test((outer) => {
    outer.mock.timers.enable()
    test((inner) => inner.mock.timers.enable())
});
```

### Before
```
✖ <anonymous> (0.536701ms)
  TypeError: Cannot redefine property: Symbol(MockTimers)
      at defineProperties (<anonymous>)
      at #createDate (node:internal/test_runner/mock/mock_timers:396:5)
      at Object.Date (node:internal/test_runner/mock/mock_timers:635:45)
      at node:internal/test_runner/mock/mock_timers:659:74
      at Array.forEach (<anonymous>)
      at #toggleEnableTimers (node:internal/test_runner/mock/mock_timers:659:5)
      at MockTimers.enable (node:internal/test_runner/mock/mock_timers:740:29)
      at TestContext.<anonymous> (file:///repro.js:5:39)
      at Test.runInAsyncScope (node:async_hooks:211:14)
      at Test.run (node:internal/test_runner/test:934:25)
```

### After
```
✖ <anonymous> (0.573319ms)
  Error [ERR_INVALID_STATE]: Invalid state: Date is already being mocked!
      at #createDate (node:internal/test_runner/mock/mock_timers:332:13)
      at Object.Date (node:internal/test_runner/mock/mock_timers:638:45)
      at node:internal/test_runner/mock/mock_timers:662:74
      at Array.forEach (<anonymous>)
      at #toggleEnableTimers (node:internal/test_runner/mock/mock_timers:662:5)
      at MockTimers.enable (node:internal/test_runner/mock/mock_timers:743:29)
      at TestContext.<anonymous> (file:///repro.js:5:39)
      at Test.runInAsyncScope (node:async_hooks:211:14)
      at Test.run (node:internal/test_runner/test:934:25)
      at Test.start (node:internal/test_runner/test:833:17) {
    code: 'ERR_INVALID_STATE'
  }
```

Changed files:
filename: lib/internal/test_runner/mock/mock_timers.js
patch: @@ -328,6 +328,9 @@ class MockTimers {
   #createDate() {
     kMock ??= Symbol('MockTimers');
     const NativeDateConstructor = this.#nativeDateDescriptor.value;
+    if (NativeDateConstructor.isMock) {
+      throw new ERR_INVALID_STATE('Date is already being mocked!');
+    }
     /**
      * Function to mock the Date constructor, treats cases as per ECMA-262
      * and returns a Date object with a mocked implementation

filename: test/parallel/test-runner-mock-timers-date.js
patch: @@ -117,4 +117,11 @@ describe('Mock Timers Date Test Suite', () => {
     assert.strictEqual(fn.mock.callCount(), 0);
     clearTimeout(id);
   });
+
+  it((t) => {
+    t.mock.timers.enable();
+    t.test('should throw when a already-mocked Date is mocked', (t2) => {
+      assert.throws(() => t2.mock.timers.enable(), { code: 'ERR_INVALID_STATE' });
+    });
+  });
 });
Repository: facebook/react
Pull request: DevTools: Lazily parse indexed map sections

[Indexed maps](http://sourcemaps.info/spec.html#h.535es3xeprgt) divide nested source maps into sections, annotated with a line and column offset. Since these sections are JSON and can be quickly parsed, we can easily separate them without doing the heavier [base64](https://en.wikipedia.org/wiki/Base64) and [VLQ](https://en.wikipedia.org/wiki/Variable-length_quantity) decoding process. This PR updates our sourcemap parsing code to defer parsing of an indexed map _section_ until we actually need to retrieve mappings from it.

Unfortunately, doing the same for the encoded `mappings` string would be difficult since most of the overhead of processing it is _decoding_ it, and we don't know how to chunk it until after decoding it.

This is probably the end of the performance tweaks for now.

Changed files:
filename: packages/react-devtools-shared/src/hooks/SourceMapConsumer.js
patch: @@ -11,6 +11,7 @@ import {decode} from 'sourcemap-codec';
 
 import type {
   IndexSourceMap,
+  IndexSourceMapSection,
   BasicSourceMap,
   MixedSourceMap,
 } from './SourceMapTypes';
@@ -34,7 +35,7 @@ export type SourceMapConsumerType = {|
 type Mappings = Array<Array<Array<number>>>;
 
 export default function SourceMapConsumer(
-  sourceMapJSON: MixedSourceMap,
+  sourceMapJSON: MixedSourceMap | IndexSourceMapSection,
 ): SourceMapConsumerType {
   if (sourceMapJSON.sections != null) {
     return IndexedSourceMapConsumer(((sourceMapJSON: any): IndexSourceMap));
@@ -137,13 +138,22 @@ function BasicSourceMapConsumer(sourceMapJSON: BasicSourceMap) {
   }: any): SourceMapConsumerType);
 }
 
+type Section = {|
+  +generatedColumn: number,
+  +generatedLine: number,
+  +map: MixedSourceMap,
+
+  // Lazily parsed only when/as the section is needed.
+  sourceMapConsumer: SourceMapConsumerType | null,
+|};
+
 function IndexedSourceMapConsumer(sourceMapJSON: IndexSourceMap) {
   let lastOffset = {
     line: -1,
     column: 0,
   };
 
-  const sections = sourceMapJSON.sections.map(section => {
+  const sections: Array<Section> = sourceMapJSON.sections.map(section => {
     const offset = section.offset;
     const offsetLine = offset.line;
     const offsetColumn = offset.column;
@@ -161,7 +171,8 @@ function IndexedSourceMapConsumer(sourceMapJSON: IndexSourceMap) {
       // The offset fields are 0-based, but we use 1-based indices when encoding/decoding from VLQ.
       generatedLine: offsetLine + 1,
       generatedColumn: offsetColumn + 1,
-      sourceMapConsumer: new SourceMapConsumer(section.map),
+      map: section.map,
+      sourceMapConsumer: null,
     };
   });
 
@@ -229,6 +240,11 @@ function IndexedSourceMapConsumer(sourceMapJSON: IndexSourceMap) {
       );
     }
 
+    if (section.sourceMapConsumer === null) {
+      // Lazily parse the section only when it's needed.
+      section.sourceMapConsumer = new SourceMapConsumer(section.map);
+    }
+
     return section.sourceMapConsumer.originalPositionFor({
       columnNumber,
       lineNumber,
Repository: ggml-org/llama.cpp
Pull request: clip : do not print ftype

Fix #12784 

Some gguf don't have it, so I think it's more simple to just don't print it


Changed files:
filename: examples/llava/clip.cpp
patch: @@ -331,7 +331,6 @@ struct clip_ctx {
     float image_std[3];
     bool use_gelu = false;
     bool use_silu = false;
-    int32_t ftype = 1;
 
     struct gguf_context * ctx_gguf = nullptr;
     struct ggml_context * ctx_data = nullptr;
@@ -1142,9 +1141,6 @@ struct clip_model_loader {
 
         // print gguf info
         {
-            int ftype = -1;
-            get_u32(KEY_FTYPE, ftype, false);
-            const std::string ftype_str = ggml_type_name(static_cast<ggml_type>(ftype));
             std::string name;
             get_string(KEY_NAME, name, false);
             std::string description;
@@ -1155,7 +1151,6 @@ struct clip_model_loader {
             LOG_INF("%s: alignment:    %zu\n", __func__, gguf_get_alignment(ctx_gguf.get()));
             LOG_INF("%s: n_tensors:    %d\n",  __func__, n_tensors);
             LOG_INF("%s: n_kv:         %d\n",  __func__, (int)gguf_get_n_kv(ctx_gguf.get()));
-            LOG_INF("%s: ftype:        %s\n",  __func__, ftype_str.c_str());
             LOG_INF("\n");
         }
Repository: facebook/react
Pull request: Update Yarn build-for-devtools script to account for build/build2 changes

Recent changes broke this.

Changed files:
filename: package.json
patch: @@ -108,7 +108,7 @@
   "scripts": {
     "build": "node ./scripts/rollup/build.js",
     "build-combined": "node ./scripts/rollup/build-all-release-channels.js",
-    "build-for-devtools": "cross-env RELEASE_CHANNEL=experimental yarn build react/index,react/jsx,react-dom,react-is,react-debug-tools,scheduler,react-test-renderer,react-refresh --type=NODE && rm -rf build && mkdir build && cp -r ./build/node_modules build/oss-experimental/",
+    "build-for-devtools": "cross-env RELEASE_CHANNEL=experimental yarn build react/index,react/jsx,react-dom,react-is,react-debug-tools,scheduler,react-test-renderer,react-refresh --type=NODE && cp -r ./build/node_modules build/oss-experimental/",
     "build-for-devtools-dev": "yarn build-for-devtools --type=NODE_DEV",
     "build-for-devtools-prod": "yarn build-for-devtools --type=NODE_PROD",
     "linc": "node ./scripts/tasks/linc.js",
Repository: electron/electron
Pull request: fix: system-context-menu with frameless BrowserWindows

#### Description of Change

Closes https://github.com/electron/electron/issues/37614
Closes https://github.com/electron/electron/issues/26726
Closes https://github.com/electron/electron/issues/24893

Fixes an issue where `system-context-menu` was not triggered as expected on Windows when using a frameless BrowserWindow. As noted by @ckerr in the above issue, Electron never sees the `WM_CONTEXTMENU` message because [`hwnd_message_handler.cc`](https://source.chromium.org/chromium/chromium/src/+/main:ui/views/win/hwnd_message_handler.cc?q=hwnd_message_handler.cc&sq=package:chromium&type=cs) uses its [own custom event handling](https://source.chromium.org/chromium/chromium/src/+/master:ui/views/win/hwnd_message_handler.cc;l=3038;drc=db9ae7941adc1d95c943accce9e0151d265fd640) for` WM_RBUTTONUP`. We can fix this by intercepting it in `NativeWindowViews::PreHandleMSG`, as suggested [here](https://github.com/electron/electron/issues/26726#issuecomment-2058524167) by @eXhumer. Confirmed to address the issue with a local build and test.

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] PR description included and stakeholders cc'd
- [x] `npm test` passes
- [x] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).

#### Release Notes

Notes: Fixed an issue where `system-context-menu` was not triggered as expected on Windows when using a frameless BrowserWindow. 

Changed files:
filename: shell/browser/native_window_views_win.cc
patch: @@ -288,6 +288,15 @@ bool NativeWindowViews::PreHandleMSG(UINT message,
 
       return false;
     }
+    case WM_RBUTTONUP: {
+      if (!has_frame()) {
+        bool prevent_default = false;
+        NotifyWindowSystemContextMenu(GET_X_LPARAM(l_param),
+                                      GET_Y_LPARAM(l_param), &prevent_default);
+        return prevent_default;
+      }
+      return false;
+    }
     case WM_GETMINMAXINFO: {
       WINDOWPLACEMENT wp;
       wp.length = sizeof(WINDOWPLACEMENT);
Repository: nodejs/node
Pull request: fs: fix parentPath returned from getDirent() when type is `UV_DIRENT_UNKNOWN`

The `parentPath` must be a path to the parent directory rather than path to the file itself.

/cc @Ethan-Arrowood @nodejs/fs 

Changed files:
filename: lib/internal/fs/utils.js
patch: @@ -301,7 +301,7 @@ function getDirent(path, name, type, callback) {
           callback(err);
           return;
         }
-        callback(null, new DirentFromStats(name, stats, filepath));
+        callback(null, new DirentFromStats(name, stats, path));
       });
     } else {
       callback(null, new Dirent(name, type, path));

filename: test/parallel/test-fs-utils-get-dirents.js
patch: @@ -75,6 +75,7 @@ const filename = 'foo';
     common.mustCall((err, dirent) => {
       assert.strictEqual(err, null);
       assert.strictEqual(dirent.name, filename);
+      assert.strictEqual(dirent.parentPath, tmpdir.path);
     },
     ));
 }
@@ -100,20 +101,22 @@ const filename = 'foo';
     common.mustCall((err, dirent) => {
       assert.strictEqual(err, null);
       assert.strictEqual(dirent.name, filenameBuffer);
-      assert.deepStrictEqual(dirent.parentPath, Buffer.from(tmpdir.resolve(`${filename}/`)));
+      assert.strictEqual(dirent.parentPath, tmpdir.path);
     },
     ));
 }
 {
   // Buffer + Buffer
   const filenameBuffer = Buffer.from(filename);
+  const dirnameBuffer = Buffer.from(tmpdir.path);
   getDirent(
-    Buffer.from(tmpdir.path),
+    dirnameBuffer,
     filenameBuffer,
     UV_DIRENT_UNKNOWN,
     common.mustCall((err, dirent) => {
       assert.strictEqual(err, null);
       assert.strictEqual(dirent.name, filenameBuffer);
+      assert.deepStrictEqual(dirent.parentPath, dirnameBuffer);
     },
     ));
 }
Repository: vercel/next.js
Pull request: doc: fix useLinkStatus import

### What?

`useLinkStatus` appears to be in `next/link`

-->


Changed files:
filename: docs/01-app/05-api-reference/04-functions/use-link-status.mdx
patch: @@ -8,7 +8,7 @@ description: API Reference for the useLinkStatus hook.
 ```tsx filename="app/loading-indicator.tsx" switcher
 'use client'
 
-import { useLinkStatus } from 'next/navigation'
+import { useLinkStatus } from 'next/link'
 
 export default function LoadingIndicator() {
   const { pending } = useLinkStatus()
@@ -19,7 +19,7 @@ export default function LoadingIndicator() {
 ```jsx filename="app/loading-indicator.js" switcher
 'use client'
 
-import { useLinkStatus } from 'next/navigation'
+import { useLinkStatus } from 'next/link'
 
 export default function LoadingIndicator() {
   const { pending } = useLinkStatus()
@@ -92,7 +92,7 @@ You can use the `useLinkStatus` hook to render a lightweight loading indicator n
 ```tsx filename="app/components/loading-indicator.tsx" switcher
 'use client'
 
-import { useLinkStatus } from 'next/navigation'
+import { useLinkStatus } from 'next/link'
 
 export default function LoadingIndicator() {
   const { pending } = useLinkStatus()
@@ -103,7 +103,7 @@ export default function LoadingIndicator() {
 ```jsx filename="app/components/loading-indicator.js" switcher
 'use client'
 
-import { useLinkStatus } from 'next/navigation'
+import { useLinkStatus } from 'next/link'
 
 export default function LoadingIndicator() {
   const { pending } = useLinkStatus()
Repository: ggml-org/llama.cpp
Pull request: readme : add rpc backend


Changed files:
filename: README.md
patch: @@ -9,13 +9,6 @@
 
 Inference of Meta's [LLaMA](https://arxiv.org/abs/2302.13971) model (and others) in pure C/C++
 
-> [!IMPORTANT]
-> New `llama.cpp` package location: [ggml-org/llama.cpp](https://github.com/ggml-org/llama.cpp/pkgs/container/llama.cpp)
->
-> Update your container URLs to: `ghcr.io/ggml-org/llama.cpp`
->
-> More info: https://github.com/ggml-org/llama.cpp/discussions/11801
-
 ## Recent API changes
 
 - [Changelog for `libllama` API](https://github.com/ggml-org/llama.cpp/issues/9289)
@@ -247,6 +240,7 @@ Instructions for adding support for new models: [HOWTO-add-model.md](docs/develo
 | [Vulkan](docs/build.md#vulkan) | GPU |
 | [CANN](docs/build.md#cann) | Ascend NPU |
 | [OpenCL](docs/backend/OPENCL.md) | Adreno GPU |
+| [RPC](https://github.com/ggml-org/llama.cpp/tree/master/examples/rpc) | All |
 
 ## Building the project
Repository: electron/electron
Pull request: fix: check screen capture permissions in `desktopCapturer`

Backport of #43080

See that PR for details.


Notes: Resolved an issue where `desktopCapturer.getSources` never fulfilled its promise in some cases.

Changed files:
filename: shell/browser/api/electron_api_desktop_capturer.cc
patch: @@ -41,6 +41,10 @@
 #include "ui/gfx/x/randr.h"
 #endif
 
+#if BUILDFLAG(IS_MAC)
+#include "ui/base/cocoa/permissions_utils.h"
+#endif
+
 #if BUILDFLAG(IS_LINUX)
 // Private function in ui/base/x/x11_display_util.cc
 base::flat_map<x11::RandR::Output, int> GetMonitors(
@@ -304,6 +308,13 @@ void DesktopCapturer::StartHandling(bool capture_window,
   capture_window_ = capture_window;
   capture_screen_ = capture_screen;
 
+#if BUILDFLAG(IS_MAC)
+  if (!ui::TryPromptUserForScreenCapture()) {
+    HandleFailure();
+    return;
+  }
+#endif
+
   {
     // Initialize the source list.
     // Apply the new thumbnail size and restart capture.
@@ -455,21 +466,25 @@ void DesktopCapturer::UpdateSourcesList(DesktopMediaList* list) {
               std::back_inserter(captured_sources_));
   }
 
-  if (!capture_window_ && !capture_screen_) {
-    v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
-    v8::HandleScope scope(isolate);
-    gin_helper::CallMethod(this, "_onfinished", captured_sources_);
+  if (!capture_window_ && !capture_screen_)
+    HandleSuccess();
+}
+
+void DesktopCapturer::HandleSuccess() {
+  v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
+  v8::HandleScope scope(isolate);
+  gin_helper::CallMethod(this, "_onfinished", captured_sources_);
 
-    screen_capturer_.reset();
-    window_capturer_.reset();
+  screen_capturer_.reset();
+  window_capturer_.reset();
 
-    Unpin();
-  }
+  Unpin();
 }
 
 void DesktopCapturer::HandleFailure() {
   v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
   v8::HandleScope scope(isolate);
+
   gin_helper::CallMethod(this, "_onerror", "Failed to get sources.");
 
   screen_capturer_.reset();

filename: shell/browser/api/electron_api_desktop_capturer.h
patch: @@ -90,6 +90,7 @@ class DesktopCapturer : public gin::Wrappable<DesktopCapturer>,
 
   void UpdateSourcesList(DesktopMediaList* list);
   void HandleFailure();
+  void HandleSuccess();
 
   std::unique_ptr<DesktopListListener> window_listener_;
   std::unique_ptr<DesktopListListener> screen_listener_;