⬆️ 👕 updated to eslint 2.1.0
Verified migration doc (nothing to be done) http://eslint.org/docs/user-guide/migrating-to-2.0.0 And made sure the eslint tasks passed
This commit is contained in:
Родитель
f3f6fa958e
Коммит
2aff0c47d0
|
@ -130,7 +130,7 @@ var unwrapArgs = function(sender, args) {
|
||||||
return Promise.resolve({
|
return Promise.resolve({
|
||||||
then: metaToValue(meta.then)
|
then: metaToValue(meta.then)
|
||||||
});
|
});
|
||||||
case 'object':
|
case 'object': {
|
||||||
let ret = v8Util.createObjectWithName(meta.name);
|
let ret = v8Util.createObjectWithName(meta.name);
|
||||||
ref = meta.members;
|
ref = meta.members;
|
||||||
for (i = 0, len = ref.length; i < len; i++) {
|
for (i = 0, len = ref.length; i < len; i++) {
|
||||||
|
@ -138,12 +138,13 @@ var unwrapArgs = function(sender, args) {
|
||||||
ret[member.name] = metaToValue(member.value);
|
ret[member.name] = metaToValue(member.value);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
case 'function-with-return-value':
|
case 'function-with-return-value':
|
||||||
returnValue = metaToValue(meta.value);
|
returnValue = metaToValue(meta.value);
|
||||||
return function() {
|
return function() {
|
||||||
return returnValue;
|
return returnValue;
|
||||||
};
|
};
|
||||||
case 'function':
|
case 'function': {
|
||||||
// Cache the callbacks in renderer.
|
// Cache the callbacks in renderer.
|
||||||
if (!sender.callbacks) {
|
if (!sender.callbacks) {
|
||||||
sender.callbacks = new IDWeakMap;
|
sender.callbacks = new IDWeakMap;
|
||||||
|
@ -172,6 +173,7 @@ var unwrapArgs = function(sender, args) {
|
||||||
});
|
});
|
||||||
sender.callbacks.set(meta.id, callIntoRenderer);
|
sender.callbacks.set(meta.id, callIntoRenderer);
|
||||||
return callIntoRenderer;
|
return callIntoRenderer;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
throw new TypeError("Unknown type: " + meta.type);
|
throw new TypeError("Unknown type: " + meta.type);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"version": "0.36.7",
|
"version": "0.36.7",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"asar": "^0.9.0",
|
"asar": "^0.9.0",
|
||||||
"eslint": "^1.10.3",
|
"eslint": "^2.1.0",
|
||||||
"request": "*"
|
"request": "*"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
|
|
|
@ -517,7 +517,6 @@ describe('asar package', function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('child_process.fork', function() {
|
describe('child_process.fork', function() {
|
||||||
child_process = require('child_process');
|
|
||||||
it('opens a normal js file', function(done) {
|
it('opens a normal js file', function(done) {
|
||||||
var child;
|
var child;
|
||||||
child = child_process.fork(path.join(fixtures, 'asar', 'a.asar', 'ping.js'));
|
child = child_process.fork(path.join(fixtures, 'asar', 'a.asar', 'ping.js'));
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
var app = require('electron').app
|
var app = require('electron').app;
|
||||||
|
|
||||||
app.on('ready', function () {
|
app.on('ready', function () {
|
||||||
// This setImmediate call gets the spec passing on Linux
|
// This setImmediate call gets the spec passing on Linux
|
||||||
setImmediate(function () {
|
setImmediate(function () {
|
||||||
app.exit(123)
|
app.exit(123);
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
|
|
||||||
process.on('exit', function (code) {
|
process.on('exit', function (code) {
|
||||||
console.log('Exit event with code: ' + code)
|
console.log('Exit event with code: ' + code);
|
||||||
})
|
});
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
exports.call = function(func) {
|
exports.call = function(func) {
|
||||||
return func();
|
return func();
|
||||||
}
|
};
|
||||||
|
|
||||||
exports.constructor = function() {
|
exports.constructor = function() {
|
||||||
this.test = 'test';
|
this.test = 'test';
|
||||||
}
|
};
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
exports.id = 1127
|
exports.id = 1127;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
process.on('message', function (msg) {
|
process.on('message', function () {
|
||||||
process.send([
|
process.send([
|
||||||
'a'.localeCompare('a'),
|
'a'.localeCompare('a'),
|
||||||
'ä'.localeCompare('z', 'de'),
|
'ä'.localeCompare('z', 'de'),
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
process.on('message', function (msg) {
|
process.on('message', function () {
|
||||||
process.send(typeof require('original-fs'));
|
process.send(typeof require('original-fs'));
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
exports.print = function(obj) {
|
exports.print = function(obj) {
|
||||||
return obj.constructor.name;
|
return obj.constructor.name;
|
||||||
}
|
};
|
||||||
|
|
||||||
exports.echo = function(obj) {
|
exports.echo = function(obj) {
|
||||||
return obj;
|
return obj;
|
||||||
}
|
};
|
||||||
|
|
|
@ -2,4 +2,4 @@ exports.twicePromise = function (promise) {
|
||||||
return promise.then(function (value) {
|
return promise.then(function (value) {
|
||||||
return value * 2;
|
return value * 2;
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
exports.property = 1127
|
exports.property = 1127;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
var ipcRenderer = require('electron').ipcRenderer;
|
var ipcRenderer = require('electron').ipcRenderer;
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
ipcRenderer.send('answer', typeof window.process);
|
ipcRenderer.send('answer', typeof window.process);
|
||||||
}
|
};
|
||||||
|
|
|
@ -3,7 +3,7 @@ process.on('uncaughtException', function(error) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
process.on('message', function(msg) {
|
process.on('message', function() {
|
||||||
setImmediate(function() {
|
setImmediate(function() {
|
||||||
process.send('ok');
|
process.send('ok');
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
onconnect = function(event) {
|
this.onconnect = function(event) {
|
||||||
var port = event.ports[0];
|
var port = event.ports[0];
|
||||||
port.start();
|
port.start();
|
||||||
port.onmessage = function(event) {
|
port.onmessage = function(event) {
|
||||||
port.postMessage(event.data);
|
port.postMessage(event.data);
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
this.onmessage = function(msg) {
|
this.onmessage = function(msg) {
|
||||||
this.postMessage(msg.data);
|
this.postMessage(msg.data);
|
||||||
}
|
};
|
||||||
|
|
|
@ -74,7 +74,7 @@ app.on('ready', function() {
|
||||||
|
|
||||||
// Send auto updater errors to window to be verified in specs
|
// Send auto updater errors to window to be verified in specs
|
||||||
electron.autoUpdater.on('error', function (error) {
|
electron.autoUpdater.on('error', function (error) {
|
||||||
window.send('auto-updater-error', error.message)
|
window.send('auto-updater-error', error.message);
|
||||||
});
|
});
|
||||||
|
|
||||||
window = new BrowserWindow({
|
window = new BrowserWindow({
|
||||||
|
@ -108,7 +108,7 @@ app.on('ready', function() {
|
||||||
// reply the result to renderer for verifying
|
// reply the result to renderer for verifying
|
||||||
var downloadFilePath = path.join(__dirname, '..', 'fixtures', 'mock.pdf');
|
var downloadFilePath = path.join(__dirname, '..', 'fixtures', 'mock.pdf');
|
||||||
ipcMain.on('set-download-option', function(event, need_cancel, prevent_default) {
|
ipcMain.on('set-download-option', function(event, need_cancel, prevent_default) {
|
||||||
window.webContents.session.once('will-download', function(e, item, webContents) {
|
window.webContents.session.once('will-download', function(e, item) {
|
||||||
if (prevent_default) {
|
if (prevent_default) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const url = item.getURL();
|
const url = item.getURL();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче