mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
refactor: improve function deprecation module (#19012)
* add removeFunction to deprecation module * clarify deprecate api * throw error * change error msg
This commit is contained in:
committed by
Cheng Zhao
parent
a90306876e
commit
d79e6bbffe
@@ -87,7 +87,7 @@ describe('deprecate', () => {
|
||||
deprecate.setHandler(m => { msg = m })
|
||||
|
||||
function oldFn () { return 'hello' }
|
||||
const deprecatedFn = deprecate.function(oldFn)
|
||||
const deprecatedFn = deprecate.removeFunction(oldFn, 'oldFn')
|
||||
deprecatedFn()
|
||||
|
||||
expect(msg).to.be.a('string')
|
||||
@@ -100,7 +100,7 @@ describe('deprecate', () => {
|
||||
|
||||
function oldFn () { return 'hello' }
|
||||
function newFn () { return 'goodbye' }
|
||||
const deprecatedFn = deprecate.function(oldFn, newFn)
|
||||
const deprecatedFn = deprecate.renameFunction(oldFn, newFn)
|
||||
deprecatedFn()
|
||||
|
||||
expect(msg).to.be.a('string')
|
||||
|
||||
Reference in New Issue
Block a user