Browse Source

update deprecation warning

Shelley Vohr 7 years ago
parent
commit
24acd74d15

+ 1 - 1
atom/common/api/atom_api_crash_reporter.cc

@@ -31,7 +31,7 @@ struct Converter<CrashReporter::UploadReportResult> {
 
 namespace {
 
-// TODO(2.0) Deprecate
+// TODO(2.0) Remove
 void SetExtraParameter(const std::string& key, mate::Arguments* args) {
   std::string value;
   if (args->GetNext(&value))

+ 4 - 2
lib/common/api/crash-reporter.js

@@ -4,7 +4,7 @@ const {spawn} = require('child_process')
 const os = require('os')
 const path = require('path')
 const electron = require('electron')
-const {app} = process.type === 'browser' ? electron : electron.remote
+const {app, deprecate} = process.type === 'browser' ? electron : electron.remote
 const binding = process.atomBinding('crash_reporter')
 
 class CrashReporter {
@@ -104,8 +104,10 @@ class CrashReporter {
     }
   }
 
-  // TODO(2.0) Deprecate
+  // TODO(2.0) Remove
   setExtraParameter (key, value) {
+    deprecate.warn('crashReporter.setExtraParameter',
+      'crashReporter.addExtraParameter or crashReporter.removeExtraParameter')
     binding.setExtraParameter(key, value)
   }
 

+ 3 - 3
spec/api-crash-reporter-spec.js

@@ -11,7 +11,7 @@ const {closeWindow} = require('./window-helpers')
 const {remote} = require('electron')
 const {app, BrowserWindow, crashReporter} = remote.require('electron')
 
-describe.only('crashReporter module', () => {
+describe('crashReporter module', () => {
   if (process.mas || process.env.DISABLE_CRASH_REPORTER_TESTS) return
 
   let originalTempDirectory = null
@@ -328,7 +328,7 @@ describe.only('crashReporter module', () => {
       const parameters = crashReporter.getParameters()
       assert(typeof parameters === 'object')
     })
-    // TODO(2.0) deprecate
+    // TODO(2.0) Remove
     it('adds a parameter with setExtraParameter', () => {
       // only run on MacOS
       if (process.platform !== 'darwin') return
@@ -353,7 +353,7 @@ describe.only('crashReporter module', () => {
       crashReporter.addExtraParameter('hello', 'world')
       assert('hello' in crashReporter.getParameters())
     })
-    // TODO(2.0) deprecate
+    // TODO(2.0) Remove
     it('removes a parameter with setExtraParameter', () => {
       // only run on MacOS
       if (process.platform !== 'darwin') return