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 () {} function CrashReporter () {}
CrashReporter.prototype.start = function (options) { 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) { if (options == null) {
options = {} options = {}
} }
@ -21,14 +21,6 @@ var CrashReporter = (function () {
ignoreSystemCrashHandler = options.ignoreSystemCrashHandler ignoreSystemCrashHandler = options.ignoreSystemCrashHandler
extra = options.extra 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 app = (process.type === 'browser' ? electron : electron.remote).app
if (this.productName == null) { if (this.productName == null) {
this.productName = app.getName() this.productName = app.getName()
@ -52,11 +44,10 @@ var CrashReporter = (function () {
extra._version = app.getVersion() extra._version = app.getVersion()
} }
if (companyName == null) { if (companyName == null) {
deprecate.log('companyName is now a required option to crashReporter.start') throw new Error('companyName is a required option to crashReporter.start')
return
} }
if (submitURL == null) { 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 return
} }
start = () => { 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 () { it('requires that the companyName and submitURL options be specified', function () {
assert.throws(function () { assert.throws(function () {
crashReporter.start({ crashReporter.start({
companyName: 'Missing submitURL' companyName: 'Missing submitURL'
}) })
}) }, /submitURL is a required option to crashReporter\.start/)
assert.throws(function () { assert.throws(function () {
crashReporter.start({ crashReporter.start({
submitURL: 'Missing companyName' submitURL: 'Missing companyName'
}) })
}) }, /companyName is a required option to crashReporter\.start/)
}) })
}) })
}) })