Destructure objects
This commit is contained in:
parent
4127b524d5
commit
2d32956903
2 changed files with 6 additions and 4 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
const ipcMain = require('electron').ipcMain;
|
const ipcMain = require('electron').ipcMain;
|
||||||
const desktopCapturer = process.atomBinding('desktop_capturer').desktopCapturer;
|
const desktopCapturer = process.atomBinding('desktop_capturer').desktopCapturer;
|
||||||
|
|
||||||
|
@ -33,7 +35,7 @@ ipcMain.on('ATOM_BROWSER_DESKTOP_CAPTURER_GET_SOURCES', function(event, captureW
|
||||||
|
|
||||||
desktopCapturer.emit = function(event, name, sources) {
|
desktopCapturer.emit = function(event, name, sources) {
|
||||||
// Receiving sources result from main process, now send them back to renderer.
|
// Receiving sources result from main process, now send them back to renderer.
|
||||||
var captureScreen, captureWindow, handledRequest, i, len, ref, ref1, ref2, request, result, source, thumbnailSize, unhandledRequestsQueue;
|
var handledRequest, i, len, ref, ref1, request, result, source, unhandledRequestsQueue;
|
||||||
handledRequest = requestsQueue.shift(0);
|
handledRequest = requestsQueue.shift(0);
|
||||||
result = (function() {
|
result = (function() {
|
||||||
var i, len, results;
|
var i, len, results;
|
||||||
|
@ -69,7 +71,7 @@ desktopCapturer.emit = function(event, name, sources) {
|
||||||
|
|
||||||
// If the requestsQueue is not empty, start a new request handling.
|
// If the requestsQueue is not empty, start a new request handling.
|
||||||
if (requestsQueue.length > 0) {
|
if (requestsQueue.length > 0) {
|
||||||
ref2 = requestsQueue[0].options, captureWindow = ref2.captureWindow, captureScreen = ref2.captureScreen, thumbnailSize = ref2.thumbnailSize;
|
const {captureWindow, captureScreen, thumbnailSize} = requestsQueue[0].options;
|
||||||
return desktopCapturer.startHandling(captureWindow, captureScreen, thumbnailSize);
|
return desktopCapturer.startHandling(captureWindow, captureScreen, thumbnailSize);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -216,7 +216,7 @@ let metaToValue = function(meta) {
|
||||||
|
|
||||||
// Construct a plain object from the meta.
|
// Construct a plain object from the meta.
|
||||||
var metaToPlainObject = function(meta) {
|
var metaToPlainObject = function(meta) {
|
||||||
var i, len, name, obj, ref1, ref2, value;
|
var i, len, obj, ref1;
|
||||||
obj = (function() {
|
obj = (function() {
|
||||||
switch (meta.type) {
|
switch (meta.type) {
|
||||||
case 'error':
|
case 'error':
|
||||||
|
@ -227,7 +227,7 @@ var metaToPlainObject = function(meta) {
|
||||||
})();
|
})();
|
||||||
ref1 = meta.members;
|
ref1 = meta.members;
|
||||||
for (i = 0, len = ref1.length; i < len; i++) {
|
for (i = 0, len = ref1.length; i < len; i++) {
|
||||||
ref2 = ref1[i], name = ref2.name, value = ref2.value;
|
let {name, value} = ref1[i];
|
||||||
obj[name] = value;
|
obj[name] = value;
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
|
|
Loading…
Reference in a new issue