Remove deprecated crashReporter.start options

This commit is contained in:
Kevin Sawicki 2016-04-28 09:48:13 -07:00
parent 6f0471f6cb
commit a6cf7a1095
2 changed files with 6 additions and 15 deletions

View file

@ -10,7 +10,7 @@ var CrashReporter = (function () {
function CrashReporter () {}
CrashReporter.prototype.start = function (options) {
var app, args, autoSubmit, companyName, deprecate, env, extra, ignoreSystemCrashHandler, start, submitURL
var app, args, autoSubmit, companyName, env, extra, ignoreSystemCrashHandler, start, submitURL
if (options == null) {
options = {}
}
@ -21,14 +21,6 @@ var CrashReporter = (function () {
ignoreSystemCrashHandler = options.ignoreSystemCrashHandler
extra = options.extra
// Deprecated.
deprecate = electron.deprecate
if (options.submitUrl) {
if (submitURL == null) {
submitURL = options.submitUrl
}
deprecate.warn('submitUrl', 'submitURL')
}
app = (process.type === 'browser' ? electron : electron.remote).app
if (this.productName == null) {
this.productName = app.getName()
@ -52,11 +44,10 @@ var CrashReporter = (function () {
extra._version = app.getVersion()
}
if (companyName == null) {
deprecate.log('companyName is now a required option to crashReporter.start')
return
throw new Error('companyName is a required option to crashReporter.start')
}
if (submitURL == null) {
deprecate.log('submitURL is now a required option to crashReporter.start')
throw new Error('submitURL is a required option to crashReporter.start')
return
}
start = () => {

View file

@ -75,18 +75,18 @@ describe('crash-reporter module', function () {
})
})
describe('.start(options)', function () {
describe.only('.start(options)', function () {
it('requires that the companyName and submitURL options be specified', function () {
assert.throws(function () {
crashReporter.start({
companyName: 'Missing submitURL'
})
})
}, /submitURL is a required option to crashReporter\.start/)
assert.throws(function () {
crashReporter.start({
submitURL: 'Missing companyName'
})
})
}, /companyName is a required option to crashReporter\.start/)
})
})
})