first pass at standardizing; suite still passing!

This commit is contained in:
Zeke Sikelianos 2016-03-24 13:15:04 -07:00 committed by Kevin Sawicki
parent f25c3d33b6
commit 4794385fac
30 changed files with 1454 additions and 1462 deletions

View file

@ -1,31 +1,31 @@
const app = require('electron').app;
const app = require('electron').app
if (!app.isReady()) {
throw new Error('Can not initialize protocol module before app is ready');
throw new Error('Can not initialize protocol module before app is ready')
}
const protocol = process.atomBinding('protocol').protocol;
const protocol = process.atomBinding('protocol').protocol
// Warn about removed APIs.
var logAndThrow = function(callback, message) {
console.error(message);
var logAndThrow = function (callback, message) {
console.error(message)
if (callback) {
return callback(new Error(message));
return callback(new Error(message))
} else {
throw new Error(message);
throw new Error(message)
}
};
}
protocol.registerProtocol = function(scheme, handler, callback) {
return logAndThrow(callback, 'registerProtocol API has been replaced by the register[File/Http/Buffer/String]Protocol API family, please switch to the new APIs.');
};
protocol.registerProtocol = function (scheme, handler, callback) {
return logAndThrow(callback, 'registerProtocol API has been replaced by the register[File/Http/Buffer/String]Protocol API family, please switch to the new APIs.')
}
protocol.isHandledProtocol = function(scheme, callback) {
return logAndThrow(callback, 'isHandledProtocol API has been replaced by isProtocolHandled.');
};
protocol.isHandledProtocol = function (scheme, callback) {
return logAndThrow(callback, 'isHandledProtocol API has been replaced by isProtocolHandled.')
}
protocol.interceptProtocol = function(scheme, handler, callback) {
return logAndThrow(callback, 'interceptProtocol API has been replaced by the intercept[File/Http/Buffer/String]Protocol API family, please switch to the new APIs.');
};
protocol.interceptProtocol = function (scheme, handler, callback) {
return logAndThrow(callback, 'interceptProtocol API has been replaced by the intercept[File/Http/Buffer/String]Protocol API family, please switch to the new APIs.')
}
module.exports = protocol;
module.exports = protocol