fix: crashReporter.getParameters() takes no params (#17459)

This commit is contained in:
Shelley Vohr 2019-03-28 15:04:16 -04:00 committed by GitHub
parent 69d4c91895
commit 808783a5e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,29 +15,17 @@ class CrashReporter {
start (options) { start (options) {
if (options == null) options = {} if (options == null) options = {}
let { const {
productName, productName,
companyName, companyName,
extra, extra = {},
ignoreSystemCrashHandler, ignoreSystemCrashHandler = false,
submitURL, submitURL,
uploadToServer uploadToServer = true
} = options } = options
if (uploadToServer == null) { if (companyName == null) throw new Error('companyName is a required option to crashReporter.start')
uploadToServer = true if (submitURL == null) throw new Error('submitURL is a required option to crashReporter.start')
}
if (ignoreSystemCrashHandler == null) {
ignoreSystemCrashHandler = false
}
if (companyName == null) {
throw new Error('companyName is a required option to crashReporter.start')
}
if (submitURL == null) {
throw new Error('submitURL is a required option to crashReporter.start')
}
const ret = this.init({ const ret = this.init({
submitURL, submitURL,
@ -48,7 +36,6 @@ class CrashReporter {
this.crashesDirectory = ret.crashesDirectory this.crashesDirectory = ret.crashesDirectory
this.crashServicePid = ret.crashServicePid this.crashServicePid = ret.crashServicePid
if (extra == null) extra = {}
if (extra._productName == null) extra._productName = ret.productName if (extra._productName == null) extra._productName = ret.productName
if (extra._companyName == null) extra._companyName = companyName if (extra._companyName == null) extra._companyName = companyName
if (extra._version == null) extra._version = ret.appVersion if (extra._version == null) extra._version = ret.appVersion
@ -103,7 +90,7 @@ class CrashReporter {
binding.removeExtraParameter(key) binding.removeExtraParameter(key)
} }
getParameters (key, value) { getParameters () {
return binding.getParameters() return binding.getParameters()
} }
} }