|
@@ -15,29 +15,17 @@ class CrashReporter {
|
|
|
start (options) {
|
|
|
if (options == null) options = {}
|
|
|
|
|
|
- let {
|
|
|
+ const {
|
|
|
productName,
|
|
|
companyName,
|
|
|
- extra,
|
|
|
- ignoreSystemCrashHandler,
|
|
|
+ extra = {},
|
|
|
+ ignoreSystemCrashHandler = false,
|
|
|
submitURL,
|
|
|
- uploadToServer
|
|
|
- } = options
|
|
|
-
|
|
|
- if (uploadToServer == null) {
|
|
|
uploadToServer = true
|
|
|
- }
|
|
|
-
|
|
|
- if (ignoreSystemCrashHandler == null) {
|
|
|
- ignoreSystemCrashHandler = false
|
|
|
- }
|
|
|
+ } = options
|
|
|
|
|
|
- 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')
|
|
|
- }
|
|
|
+ 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({
|
|
|
submitURL,
|
|
@@ -48,7 +36,6 @@ class CrashReporter {
|
|
|
this.crashesDirectory = ret.crashesDirectory
|
|
|
this.crashServicePid = ret.crashServicePid
|
|
|
|
|
|
- if (extra == null) extra = {}
|
|
|
if (extra._productName == null) extra._productName = ret.productName
|
|
|
if (extra._companyName == null) extra._companyName = companyName
|
|
|
if (extra._version == null) extra._version = ret.appVersion
|
|
@@ -103,7 +90,7 @@ class CrashReporter {
|
|
|
binding.removeExtraParameter(key)
|
|
|
}
|
|
|
|
|
|
- getParameters (key, value) {
|
|
|
+ getParameters () {
|
|
|
return binding.getParameters()
|
|
|
}
|
|
|
}
|